我无法生成签名的 apk
I can't generate signed apk
我想更新我的应用程序,但是当我尝试生成签名的 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'
}
我想更新我的应用程序,但是当我尝试生成签名的 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'
}