我正在创建一个可以编辑照片和视频的应用程序。它还通过时间轴共享编辑过的照片,这是使用Recycler视图和Card视图制作的。
每当我尝试在Android SDK 22中运行我的应用程序时出现错误,但它在Android SDK 23及更高版本中处于运行状态。
任务执行失败':app:transformClassesWithJarMergingForDebug'。
com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:com / google / android / gms / iid / zzc.class
它也发生在我正在构建apk。
我的应用程序的Gradle文件
apply plugin: 'com.android.application'
apply plugin: 'me.tatarka.retrolambda'
android {
compileSdkVersion 25
buildToolsVersion '25.0.3'
defaultConfig {
applicationId "com.practice.android.moments"
minSdkVersion 18
targetSdkVersion 25
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
manifestPlaceholders = [appPackageName: "${applicationId}"]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
jumboMode true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
/* 3)(Creative SDK) Exclude duplicate licenses */
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/LICENSE'
//help
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/DEPENDENCIES'
pickFirst 'AndroidManifest.xml'
}
}
repositories {
mavenCentral()
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.google.android.gms:play-services-auth:11.0.1'
compile 'com.google.firebase:firebase-core:11.0.1'
compile 'com.google.firebase:firebase-messaging:11.0.1'
compile 'com.google.firebase:firebase-auth:11.0.1'
compile 'com.google.firebase:firebase-database:11.0.1'
compile 'com.google.firebase:firebase-storage:11.0.1'
compile 'com.google.firebase:firebase-ads:11.0.1'
compile 'com.google.firebase:firebase-invites:11.0.1'
compile 'com.google.firebase:firebase-appindexing:11.0.1'
compile 'com.google.firebase:firebase-crash:11.0.1'
compile ('com.facebook.android:audience-network-sdk:4.11.0'){
exclude group: 'com.google.android.gms'
}
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.adobe.creativesdk.foundation:auth:0.9.1251'
compile 'com.adobe.creativesdk:image:4.8.4'
compile 'com.localytics.android:library:3.8.0'
testCompile 'junit:junit:4.12'}
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.1'}
apply plugin: 'com.google.gms.google-services'
任何人都可以帮助我......
用于测试的手机
魅族M2 Note OS版本5.1 Lollipop API 22
Redmi Note 3 OS版本6.0.1 Marshmallow API 23
Samsung Note 5 OS 7.0版Nougat API 24
答案 0 :(得分:0)
在我的情况下,出现此错误是因为我有两个不同版本的google-play-service lib。 我删除其中一个,宾果游戏! 尝试移动此编译 编译'com.google.android.gms:play-services-auth:11.0.1'