gpt4 book ai didi

android - 添加 multidex true 时出现 java.util.ZipException

转载 作者:行者123 更新时间:2023-11-29 19:34:12 25 4
gpt4 key购买 nike

错误:任务 ':app:transformClassesWithJarMergingForDebug' 执行失败。

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/api/client/http/AbstractHttpContent.class

apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.0"

defaultConfig {
applicationId "dev.com.diaginfo"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
debug {
debuggable true
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'

compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.android.support:recyclerview-v7:24.2.0'
compile 'org.apache.commons:commons-lang3:3.4'
compile 'com.android.support:design:24.2.0'
compile 'com.getbase:floatingactionbutton:1.10.1'
compile 'com.wdullaer:materialdatetimepicker:2.5.0'

compile 'com.android.volley:volley:1.0.0'
compile 'joda-time:joda-time:2.9.4'
compile 'com.google.code.gson:gson:2.7'
compile'com.google.android.gms:play-services:9.4.0'
compile 'com.android.support:multidex:1.0.1'
compile ('com.google.android.gms:play-services-identity:9.4.0') {
exclude group: 'org.apache.httpcomponents'
}

compile ('com.google.android.gms:play-services-auth:9.4.0') {
exclude group: 'org.apache.httpcomponents'
}
compile 'pub.devrel:easypermissions:0.1.5'
compile "com.squareup.picasso:picasso:2.5.2"

compile('com.google.api-client:google-api-client-android:1.22.0') {
exclude group: 'org.apache.httpcomponents'
}
compile('com.google.apis:google-api-services-drive:v3-rev35-1.22.0') {
exclude group: 'org.apache.httpcomponents'
}
compile('com.google.apis:google-api-services-sheets:v4-rev13-1.22.0') {
exclude group: 'org.apache.httpcomponents'
}
compile('com.google.apis:google-api-services-tasks:v1-rev45-1.22.0') {
exclude group: 'org.apache.httpcomponents'
}
}

apply plugin: 'com.google.gms.google-services'

我不知道如何处理这个错误,自从我添加后就出现了

 defaultConfig {
...
multiDexEnabled true
}

提前致谢。

最佳答案

您在依赖项中添加了整个 'com.google.android.gms:play-services:9.4.0' 库,然后您正在为 auth, identity< 使用拆分版本 还有。引用https://developers.google.com/android/guides/setup用于正确的构建依赖项。

关于android - 添加 multidex true 时出现 java.util.ZipException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39445471/

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