Android Studio 重复条目

vjhs03f7  于 2022-11-16  发布在  Android
关注(0)|答案(3)|浏览(153)

当我在Android 6.0和以上直接通过运行从Android工作室运行应用程序,然后能够成功运行应用程序.但当创建一个通过构建APK从Android工作室构建,然后我得到以下错误:

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug
 com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/zxing/BarcodeFormat.class**

下面是我的gradle文件:

dependencies {
compile('com.crashlytics.sdk.android:crashlytics:2.6.1@aar') {
    transitive = true;
}
compile('com.digits.sdk.android:digits:1.11.2@aar') {
    transitive = true;
}
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.dlazaro66.qrcodereaderview:qrcodereaderview:1.0.0'
compile 'com.wdullaer:materialdatetimepicker:2.4.0'
compile 'com.google.android.gms:play-services:11.0.1'
compile 'com.android.support:multidex:1.0.0'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.squareup.retrofit2:converter-scalars:2.1.0'
compile 'com.koushikdutta.ion:ion:2.1.8'
compile 'de.hdodenhof:circleimageview:2.0.0'
compile 'testfairy:testfairy-android-sdk:1.+@aar'
compile 'cn.pedant.sweetalert:library:1.3'
compile 'com.theartofdev.edmodo:android-image-cropper:2.4.+'
compile 'com.google.code.gson:gson:2.6.1'
compile 'com.facebook.android:facebook-android-sdk:4.+'
compile 'com.orhanobut:dialogplus:1.11@aar'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.google.firebase:firebase-messaging:11.0.1'
compile 'com.google.firebase:firebase-core:9.2.0'
compile 'com.google.firebase:firebase-auth:11.0.1'
compile 'dev.dworks.libs:volleyplus:+'
testCompile 'junit:junit:4.12'

}

tgabmvqs

tgabmvqs1#

您需要使用firebase的相同版本相关性

用这个

compile 'com.google.firebase:firebase-messaging:11.0.1'
compile 'com.google.firebase:firebase-core:11.0.1'
compile 'com.google.firebase:firebase-auth:11.0.1'

"而不是这个"

compile 'com.google.firebase:firebase-messaging:11.0.1'
compile 'com.google.firebase:firebase-core:9.2.0'
compile 'com.google.firebase:firebase-auth:11.0.1'
esyap4oy

esyap4oy2#

您的项目中可能有名为BarcodeFormat.java的相同档案。请将它重新命名为其他名称,然后查看错误是否已解决。

2jcobegt

2jcobegt3#

您可以排除“com.google.zxing”模块“核心”

implementation('com.facebook.android:facebook-android-sdk:{VERSION}') {
    exclude group: "com.google.zxing", module: 'core'
}

相关问题