gpt4 book ai didi

java - Android Studio : Error:Execution failed for task ':app:transformClassesWithJarMergingForRelease' .>

转载 作者:太空宇宙 更新时间:2023-11-04 11:13:06 24 4
gpt4 key购买 nike

我需要帮助,我是 Android Studio 新手,但收到此错误:

Error:Execution failed for task ':app:transformClassesWithJarMergingForRelease'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v4/database/DatabaseUtilsCompat.class

这是我的 build.gradle 文件,希望能有所帮助:

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"

defaultConfig {
applicationId "com.app_name.vallic.hr"
minSdkVersion 14
targetSdkVersion 25
multiDexEnabled true

ndk {
moduleName "player_shared"
}
}

buildTypes {
release {
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}


}

configurations {
all*.exclude group: 'com.android.support', module: 'support-v4'
all*.exclude group: 'com.android.support', module: 'support-annotations'
}

sourceSets.main {
jni.srcDirs = []// <-- disable automatic ndk-build call
}
}

dependencies {
compile('com.google.android.gms:play-services:+') {
exclude module: 'support-v4'
compile files('libs/dagger-1.2.2.jar')
compile files('libs/javax.inject-1.jar')
compile files('libs/nineoldandroids-2.4.0.jar')
compile files('libs/support-v4-19.0.1.jar')
compile('com.android.support:multidex:1.0.1')
}
}

最佳答案

multidex 还具有支持 v4 库类,您已经单独包含了 v4 库。

因此,您必须从 multidex 库中排除 support v4 模块。

像这样更改您的mulitdex库初始化。

    compile ('com.android.support:multidex:1.0.1'){
exclude module: 'support-v4'
}

你的依赖初始化应该是这样的。

dependencies {
compile('com.google.android.gms:play-services:+') {
exclude module: 'support-v4'
}
compile files('libs/dagger-1.2.2.jar')
compile files('libs/javax.inject-1.jar')
compile files('libs/nineoldandroids-2.4.0.jar')
compile files('libs/support-v4-19.0.1.jar')
compile('com.android.support:multidex:1.0.1'){
exclude module: 'support-v4'
}
}

希望有帮助:)

关于java - Android Studio : Error:Execution failed for task ':app:transformClassesWithJarMergingForRelease' .>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45781851/

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