gpt4 book ai didi

android - 尝试构建APK时出现错误 “duplicate entry: com/google/android/gms/internal/zzaac$zza.class”

转载 作者:行者123 更新时间:2023-12-03 05:10:03 26 4
gpt4 key购买 nike

嗨,我正在尝试构建APK,但iam在Android Studio中面临此问题。

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzaac$zza.class



这是我的 Gradle
    apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "someId"
minSdkVersion 19
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}



}

dependencies {

testCompile 'junit:junit:4.12'
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})

compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.volley:volley:1.0.0'
compile 'com.google.firebase:firebase-core:10.2.4'
compile 'com.google.firebase:firebase-messaging:10.2.4'
compile 'com.firebase:firebase-jobdispatcher-with-gcm-dep:0.6.0'
}

这是我的礼物(项目)
    // Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'


// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.1.1'
}
}

allprojects {
repositories {
jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

最佳答案

由于gcm play服务的不同版本存在冲突,因此导致重复的整体

从build.gradle中删除它

 compile 'com.firebase:firebase-jobdispatcher-with-gcm-dep:0.6.0'

加上这个
 compile 'com.firebase:firebase-jobdispatcher:0.8.5'

关于android - 尝试构建APK时出现错误 “duplicate entry: com/google/android/gms/internal/zzaac$zza.class”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49238858/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com