我試圖在我的應用中爲GCM添加Google Play服務,但無法實現它。無法在Android Studio(版本1.3.1)中添加GooglePlayServices(GCM)
- 出錯: 任務':app:dexDebug'的執行失敗。
com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:進程 '命令' C:\ Program Files文件\的Java \ jdk1.7.0_79 \ BIN \ java中.EXE'非零退出值2
完如果我刪除編譯「com.google.android.gms:發揮服務-GCM:8.1.0」再有就是建築沒問題。我哪裏錯了?
的build.gradle文件:
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'
}
PLZ分享您的build.gradle文件內容 – Fahim
的方式GCM應如何整合最近已更改。 https://developers.google.com/cloud-messaging/android/client – Christopher
您的build.gradle中沒有添加「apply plugin:'com.google.gms.google-services'」。 – Christopher