0

我正在facebook analyticsphonegap平臺上工作。我已經有facebook plugins登錄和註冊,這是完美的工作。com.android.build.api.transform.TransformException:java.util.zip.ZipException:重複條目:com/facebook/AccessToken.class

Facebook plugins擁有自己的模塊。這是path: "phonegap-facebook-plugin:FacebookLib", configuration: "release"。你可以在gradle文件中看到這個。

我嘗試了一些SO解決方案,但沒有爲我工作。

在爲facebook analytics添加compile dependencies之後,我收到以下錯誤消息。

錯誤日誌:

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:[email protected]') { 
     transitive = true; 
    } 

回答

0

最後我解決了這個問題。

問題出在Android Studio版本。

我的Android Studio is 2.2.2的版本,當我試圖執行與此版本的應用程序它出現錯誤。

但是,當我降級Android Studio版本2.2.1然後所有工作正常,執行沒有錯誤。

相關問題