我想執行的代碼但我在郵件中收到錯誤消息gradle這個建立是執行失敗的任務「:應用程序:transformClassesWithDexForDebug」
Execution failed for task ':app:transformClassesWithDexForDebug'.
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_45\bin\java.exe'' finished with non-zero exit value 2
的build.gradle(應用模塊)我的項目是。
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.0"
defaultConfig {
applicationId "com.paulusworld.drawernavigationtabs"
minSdkVersion 15
targetSdkVersion 23
/* multiDexEnabled true*/
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile files('libs/android-support-v23.jar')
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
}
build gradle(project navigationtab)
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
}
}
allprojects {
repositories {
jcenter()
}
}
嘿約翰感謝您的及時迴應。如果我將uncomment multiDexEnabled true取消註釋。我收到另一個錯誤消息,即錯誤:任務':app:transformClassesWithJarMergingForDebug'的執行失敗。 > com.android.build.api.transform.TransformException:java.util.zip.ZipException:重複條目:android/support/v4/util/MapCollections $ ArrayIterator.class –
我已經更新了我的答案.... – johnrao07
是啊你說得對,John錯誤地寫了build(NavigationDrawer)而不是項目(NavigationDrawer)。 –