Android GCM,gradle can';不能正确同步

Android GCM,gradle can';不能正确同步,android,gradle,google-cloud-messaging,android-gradle-plugin,Android,Gradle,Google Cloud Messaging,Android Gradle Plugin,我是GCM的新手,第一次尝试。 我按照谷歌提供的文档进行操作。 我尝试使用如下设置的gradle文件构建和运行项目: dependencies { classpath 'com.android.tools.build:gradle:1.3.0' classpath 'com.google.gms:google-services:2.0.0-beta2' } 但我得到了下一个错误: 错误:任务“:app:processDebugGoogleServices”的执行失败。

我是GCM的新手,第一次尝试。 我按照谷歌提供的文档进行操作。 我尝试使用如下设置的gradle文件构建和运行项目:

dependencies {  
    classpath 'com.android.tools.build:gradle:1.3.0'
    classpath 'com.google.gms:google-services:2.0.0-beta2'
}


但我得到了下一个错误:

错误:任务“:app:processDebugGoogleServices”的执行失败。 请通过更新google services插件的版本(有关最新版本的信息,请访问)或将com.google.android.gms的版本更新为8.3.0来修复版本冲突。”


当我尝试将其更改为8.3.0或8.3+时,出现以下错误:

错误:任务“:app:processDebugResources”的执行失败。 com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:process'command'/Users/sarigbrand/Library/android/sdk/build tools/23.0.0/aapt''以非零退出值1结束
错误:(18)标记属性名称包含无效字符“>”。
错误:(14)标记属性名称包含无效字符“>”

此问题使我的debug.manifest全部变为红色并充满错误,我的项目将完全不同步


我尝试过的其他事情:

  • 谷歌服务版本-2.0.0-alpha9,1.5.0-beta2,1.5.0,1.3.0
  • 我试图删除android studio并重新安装(旧版本-1.3,新版本1.5)
  • 我尝试下载gradle 2.10或从包装文件运行它(在重新安装之前,我被要求这样做):


  • 
    

    从项目级
    build.gradle
    删除此项:

    classpath 'com.google.gms:google-services:2.0.0-beta2'
    
    compile 'com.google.android.gms:play-services-gcm:8.4.0'
    
    使用此选项在您的
    应用程序构建中引用GCM服务。gradle

    classpath 'com.google.gms:google-services:2.0.0-beta2'
    
    compile 'com.google.android.gms:play-services-gcm:8.4.0'
    

    这对我有效

    好的,我刚刚尝试过,我被要求更新到gradle 2.2,我刚刚更新了,但我现在得到了这个错误:错误:(2,0)id为'com.google.gms.google services'的插件找不到。当我点击open file(打开文件)时,他指的是行>应用插件中的应用程序gradle文件:“com.google.gms.google-services”你应该删除
    apply-plugin
    行,然后重新同步gradle当然我也试过了,我在尝试8.3.0时也遇到了同样的错误,它打开了宣言文件我遇到了很多语法错误错误:(14)标记属性名称包含无效字符“>”。错误:(18)标记属性名称包含无效字符“>”。错误:任务的执行失败:app:processDebugResources'>com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:process“command”/Users/sarigbrand/Library/android/sdk/build tools/23.0.0/aapt''已完成,退出值为非零1
    compile 'com.google.android.gms:play-services-gcm:8.4.0'