我创建了一个简单的hello world项目,但是我收到以下错误:
Error: Execution failed for task '`:app:transformClassesWithDexForDebug`'.
> 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 1.
我在 build.gradle 中添加了multiDexEnabled true
,但仍然显示上述错误。
我的 build.gradle 文件: -
android {
compileSdkVersion 23
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.bliss76.myapplication"
minSdkVersion 19
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
}
答案 0 :(得分:0)
你还记得改变清单吗?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myapp">
<application
android:name="android.support.multidex.MultiDexApplication" >
...
</application>
详细了解here。
答案 1 :(得分:0)
尝试在依赖项中附加
compile 'com.android.support:support-v4:23.4.0'