在尝试在项目中实现Admobs时,我在构建apk过程中面临以下问题。
错误:任务执行失败':app:transformClassesWithJarMergingForRelease'。
com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:com / google / android / gms / iid / zzc.class
的build.gradle
apply plugin: 'com.android.application'
apply plugin: 'me.tatarka.retrolambda'
android {
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
}
defaultConfig {
// ...
multiDexEnabled true
}
dexOptions {
jumboMode true
}
compileSdkVersion 23
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "eazy.picsart"
minSdkVersion 16
targetSdkVersion 23
versionCode 2
versionName "2.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
manifestPlaceholders = [appPackageName: "${applicationId}"]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
/* compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}*/
/* 3) Exclude duplicate licenses */
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/DEPENDENCIES'
pickFirst 'AndroidManifest.xml'
exclude 'com/google/android/gms/ads/AdActivity.class'
}
aaptOptions{
cruncherEnabled = false
}
}
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'
})
testCompile 'junit:junit:4.12'
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'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.google.android.gms:play-services-ads:11.0.1'
}