【发布时间】:2017-08-20 11:54:18
【问题描述】:
我需要帮助,我是 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')
}
}
【问题讨论】:
-
检查我更新的答案。
-
嗨,我在哪里可以更改多索引库初始化?
-
您好,已经改了,感谢您的帮助,但还是出现同样的错误。
-
为什么要使用编译文件('libs/support-v4-19.0.1.jar')?这是一个非常非常老的版本。
-
嗨,加布里埃尔,那我该怎么办?更新?
标签: java android android-studio gradle android-gradle-plugin