2016-04-24 54 views
1

錯誤:Gradle:任務':app:dexDebug'的執行失敗。執行失敗的任務':app:dexDebug'非零退出值2

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/local/java/jdk1.8.0_73/bin/java'' finished with non-zero exit value 2
This Error comes in all my projects

的build.gradle文件

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 23 
    buildToolsVersion "23.0.2" 

    defaultConfig { 
     applicationId "com.example.mukesh.airpollution" 
     minSdkVersion 15 
     targetSdkVersion 23 
     versionCode 1 
     versionName "1.0" 
    } 

    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    compile group: 'cz.msebera.android', name: 'httpclient', version: '4.4.1.1' 
} 

dependencies { 
    compile 'com.android.support:recyclerview-v7:23.1.1' 
} 

dependencies { 
    compile 'com.loopj.android:android-async-http:1.4.4' 
} 

dependencies { 
    compile 'com.google.code.gson:gson:2.2.4' 
} 

dependencies { 
    compile group: 'cz.msebera.android', name: 'httpclient', version: '4.4.1.1' 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    testCompile 'junit:junit:4.12' 
    compile 'com.android.support:appcompat-v7:23.1.1' 
    compile 'com.google.android.gms:play-services:8.3.0' 
    compile 'com.google.maps.android:android-maps-utils:0.4+' 
} 
+0

發佈您的build.gradle文件。 –

+0

這可能是一個multidex問題。嘗試應用multidex支持。看到http://stackoverflow.com/questions/32407985/android-app-loading-library-at-runtime-on-lollipop-but-not-icecreamsandwich/36263927#36263927 – Devrim

+0

@MonishKamble添加gradle文件 –

回答

1

嘗試壓縮你的build.gradle如下(爲HttpClient的刪除重複項):

apply plugin: 'com.android.application' 

android { 
compileSdkVersion 23 
buildToolsVersion "23.0.2" 

defaultConfig { 
    applicationId "com.example.mukesh.airpollution" 
    minSdkVersion 15 
    targetSdkVersion 23 
    versionCode 1 
    versionName "1.0" 
} 

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.1.1' 
compile 'com.android.support:recyclerview-v7:23.1.1' 
compile 'com.google.android.gms:play-services:8.3.0' 
compile 'com.google.maps.android:android-maps-utils:0.4+' 
compile 'com.google.code.gson:gson:2.2.4' 
compile 'com.loopj.android:android-async-http:1.4.4' 
compile group: 'cz.msebera.android', name: 'httpclient', version: '4.4.1.1' 
} 

告訴我它是否有效?

+0

這也給同樣的錯誤。 –

相關問題