0

In my project I was using the following version of GCM library.

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

Now I update it in to the following version

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

But I am getting the following error.

02-05 23:51:29.205 18410-18410/com.example.app E/GMPM: GoogleService failed to initialize, status: 10, Missing an expected resource: 'R.string.google_app_id' for initializing Google services.  Possible causes are missing google-services.json or com.google.gms.google-services gradle plugin.
02-05 23:51:29.205 18410-18410/com.example.app E/GMPM: Scheduler not set. Not logging error/warn.
02-05 23:51:29.238 18410-18452/com.example.app E/GMPM: Uploading is not possible. App measurement disabled

Please help me to solve this issue.

I have configured my project with the following too

apply plugin: 'com.google.gms.google-services'

.

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


    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
Vinil Chandran
  • 1,563
  • 1
  • 19
  • 33

1 Answers1

1

Newer versions of GoogleServices require a JSON file that contains configuration information about your app and account.

Follow the instructions provided here.

You might also see better results by upgrading to the latest build tools (as of 5 Feb 2016):

buildToolsVersion "23.0.2"

and

classpath 'com.android.tools.build:gradle:2.0.0-beta2'
classpath 'com.google.gms:google-services:2.0.0-beta2'

The new tools expect the google-services plugin to be applied at the bottom of the build file, as shown in this example. FWIW, I'm building with these settings and not seeing the error.

Additional information about the google-services.json file, with troubleshooting tips, is provided here.

Bob Snyder
  • 37,759
  • 6
  • 111
  • 158
  • Ya. Sure. I have already configured and past that google-services.json into my project in previous version play-services-gcm:7.8.0. And i tried by changing it again. But the same error is seen. – Vinil Chandran Feb 06 '16 at 03:23
  • Is beta is prefix adding to the trial version? Then is it good using beta version forever? – Vinil Chandran Feb 06 '16 at 07:13
  • @VinilChandran: I'm not sure what you are asking. The tools seem to be evolving and improving all the time. I try to stay close to the latest released versions. Release notes are [here](http://tools.android.com/tech-docs/new-build-system) and [here](http://android-developers.blogspot.com/2016/02/android-studio-20-beta.html). – Bob Snyder Feb 06 '16 at 07:23
  • @qbix Thanks for your help. I have solved the issue with your help. And I also changed the graddle inside C:\Program Files\Android\Android Studio\gradle\ from gradle-2.8 to gradle-2.10. – Vinil Chandran Feb 06 '16 at 11:09