I'm trying to add google play services for GCM in my app but couldn't achieve it.
- What went wrong: Execution failed 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'' finished with non-zero exit value 2
If I remove compile 'com.google.android.gms:play-services-gcm:8.1.0' then there is no problem in building. Where I'm going wrong?
Build.gradle File:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "xxx.yyy.zzz"
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/LICENSE'
}
dexOptions {
jumboMode true
incremental true
preDexLibraries false
javaMaxHeapSize "4g"
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.code.gson:gson:2.3'
compile 'com.github.bumptech.glide:glide:3.5.2'
compile 'com.google.android:multidex:0.1'
compile 'com.edmodo:cropper:1.0.1'
compile 'com.google.android.gms:play-services-analytics:7.3.0'
compile 'com.loopj.android:android-async-http:1.4.5'
compile 'com.google.android.gms:play-services-gcm:8.1.0'
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.jakewharton:butterknife:6.1.0'
compile 'com.afollestad:material-dialogs:0.7.4.2'
}