2015-10-19 101 views
2

我已经收到以下错误:摇篮大厦错误

Error:Execution failed for task ':app:dexDebug'.> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2

这是我目前的依赖性。我一直在试图弄清楚如何解决这个错误,但我无法弄清楚。任何建议或帮助将不胜感激。

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 23 
    buildToolsVersion "23.0.1" 

    defaultConfig { 
     applicationId "com.example.vokanovich.myapplication" 
     minSdkVersion 16 
     targetSdkVersion 23 
     versionCode 1 
     versionName "1.0" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    compile ("com.magnet.mmx:magnet-mmx-client-android:[email protected]") { 
    transitive=true 
    } 
    compile 'com.google.android.gms:play-services:8.1.0' 
    compile 'com.google.android.gms:play-services-base:7.8.0' 
    compile 'com.google.android.gms:play-services-gcm:7.8.0' 
    compile('com.mikepenz:materialdrawer:[email protected]') { 
     transitive = true 
    } 

    compile fileTree(dir: 'libs', include: ['*.jar']) 
    testCompile 'junit:junit:4.12' 
    compile 'com.squareup.picasso:picasso:2.5.2' 
    compile 'com.android.support:appcompat-v7:23.1.0' 
    compile 'com.android.support:design:23.1.0' 
} 

这是我其他的build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules. 

buildscript { 
    repositories { 
     jcenter() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:1.3.0' 

     // NOTE: Do not place your application dependencies here; they belong 
     // in the individual module build.gradle files 
    } 
} 


allprojects { 
    repositories { 
     jcenter() 
     mavenLocal() 
     maven { 
      url "https://repo.magnet.com/artifactory/public" 
     } 
    } 
} 

task clean(type: Delete) { 
    delete rootProject.buildDir 
} 
+1

你可以尝试http://stackoverflow.com/a/33099224/3702862? – Rajesh

+1

[This](http://stackoverflow.com/questions/29756188/java-finished-with-non-zero-exit-value-2-android-gradle)链接可能会解决您的问题。 –

+0

http://stackoverflow.com/a/31759781/1371041为我解决它。感谢您的帮助。 – ChallengeAccepted

回答

2

我有同样的问题。只是里面defaultConfig写的build.gradle defaultConfig { multiDexEnabled true }

希望这有助于你!)

+0

总是建议减少未使用的库代码,而不是使用multiDexEnabled。如果不能解决问题,那么你应该使用multiDexEnabled作为最后的手段。 – ChallengeAccepted

+0

即使尝试此操作,我仍然会收到错误消息 –