【发布时间】:2016-09-22 04:45:39
【问题描述】:
我在 android studio 中生成签名 apk 时出错
Error:Execution failed for task ':AppName:transformClassesWithJarMergingForRelease'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/common/internal/zzv$zza$zza.class
Gradle....
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "myApp"
minSdkVersion 14
targetSdkVersion 23
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
dexOptions {
javaMaxHeapSize "2g"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
}
dependencies {
compile 'org.altbeacon:android-beacon-library:2.1.4'
compile project(':qRCodeReaderViewlib')
compile project(':viewpagerindicator')
compile 'com.android.support:support-v4:23.1.1'
compile 'com.google.android.gms:play-services-maps:9.0.0'
compile 'com.android.support:appcompat-v7:23.1.1'
compile files('libs/android-query-full.0.26.7.jar')
//compile files('libs/gcm.jar')
compile files('libs/mint-4.4.0.jar')
compile 'com.squareup.okhttp3:okhttp:3.2.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.google.firebase:firebase-messaging:9.4.0'
}
// Add to the bottom of the file
apply plugin: 'com.google.gms.google-services'
有什么帮助吗?提前谢谢..
【问题讨论】:
-
将此行添加到依赖项..compile fileTree(dir: 'libs', include: ['*.jar'])..并将jar文件添加到依赖项..并同步项目