0

我正在平台上facebook analytics工作phonegap。我已经可以facebook plugins进行登录和注册,并且运行良好。

Facebook plugins拥有自己的模块。这是path: "phonegap-facebook-plugin:FacebookLib", configuration: "release"。您可以在下面的gradle文件中看到这一点。

我已经尝试了一些 SO 解决方案,但对我不起作用。

添加后compile dependenciesfacebook analytics收到以下错误。

错误日志:

Error:Execution failed for task ':transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/facebook/AccessToken.class

这是我的build.gradle

dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    // SUB-PROJECT DEPENDENCIES START
    debugCompile project(path: "CordovaLib", configuration: "debug")
    releaseCompile project(path: "CordovaLib", configuration: "release")
    debugCompile project(path: "phonegap-facebook-plugin:FacebookLib", configuration: "debug")
    releaseCompile project(path: "phonegap-facebook-plugin:FacebookLib", configuration: "release")
    compile "com.android.support:support-v4:+"
    compile "com.google.android.gms:play-services-auth:+"
    compile "com.google.android.gms:play-services-identity:+"
    compile "com.google.firebase:firebase-core:+"
    compile "com.google.firebase:firebase-messaging:+"
    compile "com.google.firebase:firebase-crash:+"
    compile "com.google.firebase:firebase-config:+"
    compile "com.mixpanel.android:mixpanel-android:4.9.1"
    compile "com.google.android.gms:play-services-base:+"
    compile "com.google.android.gms:play-services-gcm:+"
    compile 'com.facebook.android:facebook-android-sdk:[4,5)'
    compile('com.crashlytics.sdk.android:answers:1.3.10@aar') {
        transitive = true;
    }
4

1 回答 1

0

最后我解决了这个问题。

问题在于Android Studio版本。

Android Studio is 2.2.2当我尝试使用此版本执行应用程序时,我的版本出现错误。

但是当我降级Android Studio版本时2.2.1,一切正常并且执行没有错误。

于 2016-10-27T08:24:17.587 回答