0

I'm trying to understand the reason for an error. Here is what I did:

  • Start Android Studio
  • Start a new project with a Blank Activity
  • Add the line compile 'com.google.android.gms:play-services:8.4.0' to the dependencies section of the app module build.gradle

That's it. If I now run this app, it gives me the the following error in logcat:

03-01 14:28:58.646 3133-3133/local.abc.t2 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.
03-01 14:28:58.646 3133-3133/local.abc.t2 E/GMPM: Scheduler not set. Not logging error/warn.
03-01 14:28:58.756 3133-3191/local.abc.t2 E/GMPM: Uploading is not possible. App measurement disabled

However, if I replace com.google.android.gms:play-services:8.4.0 by com.google.android.gms:play-services-location:8.4.0, the error is no longer present.

I know that the play-services version includes multiple Google Play service APIs and play-services-location includes only the location APIs. So, at least one of the other APIs is causing the above error. Which one is causing which error and how can I find out?

  • This is strange, you should not need to use the google-services.json unless you're doing GCM stuff. Maybe check your gradle configuration. Regardless, have a look here: http://stackoverflow.com/questions/34365369/googleservice-failed-to-initialize – Daniel Nugent Mar 01 '16 at 22:51

1 Answers1

0

The problem is probably in the "Maps" API, which requires a key created from Google Developer's Console.

Most other APIs require a key as well

Salman Tariq
  • 353
  • 1
  • 11