2016-10-22 34 views
1

我使用api創建Shopify Android應用程序。我的應用也使用Google Firebase進行登錄。這是我的依賴。多個dex文件定義Lcom/google/android/gms/internal/zzrx;

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile 'com.android.support:appcompat-v7:24.1.1' 
    compile 'com.shopify.mobilebuysdk:buy:2.0.2' 
    compile 'com.google.firebase:firebase-auth:9.6.1' 
    compile 'com.google.android.gms:play-services-auth:9.6.1' 
} 

當我嘗試建立我得到這個錯誤的程序:

錯誤:執行失敗的任務「:應用程序:transformClassesWithDexForDebug」。

com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/internal/zzrx;

我嘗試添加這對我的build.gradle(應用程序):

defaultConfig { 
    multiDexEnabled true 
} 

所以再得到這個:

錯誤:執行失敗的任務 ':應用程序:transformClassesWithJarMergingForDebug' 。

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzrx.class

我該怎麼做才能在同一個項目中使用這兩個庫?

+0

這解決了我的問題: 配置{ all * .exclude group:'com.google.android.gms',module:'play-services-wallet' } –

回答

1

解決幫助

我只是解決了我的問題,此行:

configurations { 
    all*.exclude group: 'com.google.android.gms', module: 'play-services-wallet' 
} 
0

嘗試添加這,可能在的build.gradle

packagingOptions { 
    exclude 'META-INF/DEPENDENCIES' 
    exclude 'META-INF/NOTICE' 
    exclude 'META-INF/LICENSE' 
    exclude 'META-INF/license.txt' 
    exclude 'META-INF/notice.txt' 
} 
+0

我還沒有成功。 –

相關問題