我想更新我的应用程序,但是当我尝试生成签名的apk时,收到以下消息错误:
Warning:warning: Cannot find annotation method ‘value()’ in type
‘GuardedBy’: class file for javax.annotation.concurrent.GuardedBy not
found
Error:Error converting bytecode to dex: Cause:
com.android.dex.DexException: Multiple dex files define
Lbolts/AppLink$Target;
Error:Execution failed for task
‘:app:transformClassesWithDexForDebug’.
com.android.build.api.transform.TransformException:
com.android.ide.common.process.ProcessException:
java.util.concurrent.ExecutionException:
com.android.ide.common.process.ProcessException:
org.gradle.process.internal.ExecException: Process ‘command
‘/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/bin/java”
finished with non-zero exit value 2
请帮忙!!
解决方法:
像这样尝试multiDexEnabled true:
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
}
EDIT :
And if you don’t know which part to exclude just add below code to
your build.gradle just below defaultConfig:
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/license.txt'
exclude 'META-INF/notice.txt'
}
标签:android-studio,apk,android
来源: https://codeday.me/bug/20191118/2031074.html