我遇到了这个运行时错误。它说:
错误:任务 ':app:dexDebug' 执行失败。
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/java-8-oracle/bin/java'' finished with non-zero exit value 2
这是我的 build.gradle 脚本:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.stratbeans.barium.mobilebarium"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:design:23.1.0'
compile files('libs/universal-image-loader-1.9.3.jar')
compile files('libs/listviewanimations_lib-core-slh_3.1.0.jar')
compile project(':ListViewAnimations-core')
compile project(':StickyListHeaders')
compile project(':ListViewAnimations-core-slh')
请帮助我。谢谢!
最佳答案
You should audit your project for unwanted dependencies and remove as much unused code as possible using ProGuard.
- 更改 Gradle 构建配置以启用 multidex
- 修改 list 以引用 MultiDexApplication 类
修改您的应用 Gradle 构建文件配置以包含支持库并启用 multidex 输出。
android {
compileSdkVersion 21
buildToolsVersion "21.1.0"
defaultConfig {
applicationId "com.stratbeans.barium.mobilebarium"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
// Enabling multidex support.
multiDexEnabled true
}
...
}
dependencies {
compile 'com.android.support:multidex:1.0.0'
}
关于java - 错误 :Execution failed for task ':app:dexDebug' at runtime,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33605002/