Home Ask Login Register

Developers Planet

Your answer is one click away!

Roee February 2016

Android GCM, gradle can't sync properly

I'm new to GCM and trying it for the first time. I followed the documentation as google guide us to. I tried to build and run the project with gradle files set up as followed:

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

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.0.0'
    compile 'com.google.android.gms:play-services:8.4.0'
}

But I'm getting the next Error:

Error:Execution failed for task ':app:processDebugGoogleServices'. Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 8.3.0."


When I tried to change it to 8.3.0 or 8.3+ I get this error:

Error:Execution failed for task ':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'' finished with non-zero exit value 1
Error:(18) Tag attribute name has invalid character '>'.
Error:(14) Tag attribute name has invalid character '>'."

This issue make my debug.manifest all red and full of errors and my project won't sync at all


Other things I tried:

  1. google-services versions - 2.0.0-alpha9, 1.5.0-beta2, 1.5.0, 1.3.0.
  2. I tried to delete android studio and reinstall (old version - 1.3, new version 1.5)
  3. I tried to download gradle 2.10 or r

Answers


fillobotto February 2016

Remove this from project-level build.gradle:

classpath 'com.google.gms:google-services:2.0.0-beta2'

Use this to reference GCM service in your app build.gradle:

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

This is working for me

Post Status

Asked in February 2016
Viewed 1,801 times
Voted 10
Answered 1 times

Search




Leave an answer


Quote of the day: live life