Gradle Build Failed - Java.exe file terminated with nonzero exit value 2

I added recyclerview gradle build, and then tried to run the application, and now I get this error:

Error: execution completed for task ': app: dexDebug'.

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: process "command C: \ Program Files \ Java \ jdk1.7.0_79 \ bin \ java.exe '' terminated with a non-zero value exit 2

Here is my gradle build file:

dependencies {
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'com.android.support:recyclerview-v7:22.1.1'
compile fileTree(dir: 'libs', include: 'Parse-*.jar')
compile 'com.parse.bolts:bolts-android:1.2.0'
compile 'com.android.support:design:22.2.0'
compile 'com.google.android.gms:play-services:7.5.0'
compile 'com.facebook.fresco:fresco:0.5.2+'
compile 'com.facebook.android:facebook-android-sdk:4.1.0'
compile fileTree(dir: 'libs', include: 'commons-io-*.jar')
compile fileTree(dir: 'libs', include: 'ParseFacebookUtilsV4-*.jar')
}

How to fix it?

+4
source share
2 answers

It looks like you have reached the dex limit, and you have more than 65 thousand methods in your application.

gradle , multidex , , dex.

Google Play. , , , .

:

com.google.android.gms:play-services-maps:7.5.0
com.google.android.gms:play-services-gcm:7.5.0

:

compile 'com.google.android.gms:play-services:7.5.0'

Google Play Services, , .

+8

Android Studio ,

+ , .

+ , , .

, , .

, .

+1

All Articles