我正在尝试根据此网站上的步骤在Android Studio中实现GCM客户端:在Android上实现GCM客户端
如“设置Google Play服务”下所述,我编辑了应用程序的build.gradle文件,使其如下所示:
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 20
buildToolsVersion "23.0.0"
defaultConfig {
applicationId "com.buuurn.gymio"
minSdkVersion 16
targetSdkVersion 21
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:support-v4:23.0.0'
compile 'com.google.android.gms:play-services:7.+'
}
如果现在同步gradle,会出现以下错误信息:
Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Applications/adt-bundle 23/sdk/build-tools/23.0.0/aapt'' finished with non-zero exit value 1
我已经尝试更改
compile 'com.google.android.gms:play-services:7.+'
即,也就是。
compile 'com.google.android.gms:play-services:7.8.0'
但是出现了相同的错误。
我也读过一些关于添加Google服务时遇到Gradle错误的帖子,但还没有找到解决方法。
谢谢!
23
而不是23.0.0
,并且它在单引号中'23'
。 - tyczj