2016-10-22 30 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

我还没有成功。 –

相关问题