gpt4 book ai didi

java - 错误 : finished with non-zero exit value2

转载 作者:太空狗 更新时间:2023-10-29 16:14:31 24 4
gpt4 key购买 nike

我已经在我的应用程序中导入了一个模块。当我尝试运行它时,控制台向我显示此错误:**错误:任务 ':app:dexDebug' 执行失败。

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2**

我有 2 个 gradle。

1st gradle(我的申请)

apply plugin: 'test.test.myapplication'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "alo.com.geoapp"
minSdkVersion 8
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}

}dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile files('libs/gson-2.2.2.jar')
compile project(':sdktools')}

2nd gradle(导入模块)

apply plugin: 'com.android.library'
android {
compileSdkVersion 21
buildToolsVersion "20.0.0"
defaultConfig {
minSdkVersion 8
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
}
}
}


dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile files('libs/SKMaps.jar')
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.google.guava:guava:18.0'
compile 'joda-time:joda-time:2.4'}

我已经尝试更新我的 jdk(从 7.* 到 8.*),但没有解决。

谢谢!

最佳答案

如果你有超过 65k 的方法,你应该使用 multidex ( http://developer.android.com/tools/building/multidex.html )。

在你的gradle上:

multiDexEnabled true

要检查您是否有超过 65 个方法,您应该使用 proguard 功能,或者更简单地使用这个库来检查有多少方法 https://github.com/KeepSafe/dexcount-gradle-plugin?utm_source=Android+Weekly&utm_campaign=553bcbfc02-Android_Weekly_174&utm_medium=email&utm_term=0_4eb677ad19-553bcbfc02-337295057

关于java - 错误 : finished with non-zero exit value2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33296786/

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