【发布时间】:2015-08-31 11:07:17
【问题描述】:
向项目添加 jar 文件后,我似乎无法修复此错误:
任务 ':app:dexDebug' 执行失败。 com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command'/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/java'' 完成非零退出值 1
该程序在没有 jar 文件的情况下运行,但是当我添加它时,一切都构建了,但是当我尝试运行它时它给了我这个错误。我已经搜索并尝试了以下解决方案,但没有解决该错误。
why java.exe exit with value 1 in android studio
Error:Execution failed for task ':app:dexDebug'. > comcommand finished with non-zero exit value 2
Android java.exe finished with non-zero exit value 1
由于这些解决方案都不起作用,我认为这是一个超过 65k 的方法问题,所以我编辑了我的 build.gradle,但问题仍然存在。
https://developer.android.com/tools/building/multidex.html
这是我的应用项目的 build.grade:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
................
minSdkVersion 15
targetSdkVersion 21
multiDexEnabled = true
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.android.support:multidex:1.0.0'
compile files('libs/xyz.jar')
}
我不知道如何解决这个问题。任何帮助将不胜感激。
【问题讨论】:
标签: java android android-studio jar