![](/img/trans.png)
[英]Execution failed for task ':app:dexDebug' in Android Studio
[英]Error:Execution failed for task ':app:dexDebug'… using android studio
我正在使用這個庫https://github.com/mikepenz/MaterialDrawer
當我嘗試運行我的項目時,我收到以下錯誤:
錯誤:
錯誤:任務':app:dexDebug'的執行失敗。 com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:進程'命令'/Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java''完成非零退出值2
如果我嘗試使用jdk1.7
錯誤:任務':app:dexDebug'的執行失敗。 com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:進程'命令'C:\\ Program Files \\ Java \\ jdk1.7.0_45 \\ bin \\ java.exe''以非完成零退出值2
這是我的build.gradle
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.test"
minSdkVersion 14
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'com.android.support:recyclerview-v7:+'
compile 'com.google.android.gms:play-services:7.5.0'
compile 'com.google.code.gson:gson:2.3'
compile 'com.mcxiaoke.volley:library:1.0.+'
compile fileTree(dir: 'libs/httpclient', include: ['*.jar'])
compile 'com.afollestad:material-dialogs:0.7.6.0'
compile 'com.blunderer:materialdesignlibrary:2.0.0'
compile 'com.github.navasmdc:MaterialDesign:1.5@aar'
//https://github.com/mikepenz
compile('com.mikepenz:materialdrawer:3.1.2@aar') {
transitive = true
}
compile('com.mikepenz:aboutlibraries:5.0.7@aar') {
transitive = true
}
compile('com.crashlytics.sdk.android:crashlytics:2.4.0@aar') {
transitive = true;
}
}
我也嘗試這些解決方案,但它不起作用:
defaultConfig {
...
multiDexEnabled = true
}
和
dependencies {
...
compile 'com.android.tools.build:gradle:1.1.2'
...
}
您的問題應該通過指定 -
defaultConfig {
// Enabling multidex support.
multiDexEnabled true
}
您可以在65K方法限制下閱讀更多相關信息
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.