-1

I'm trying to get the Getting the Last Known Location tutorial from Android Developers to work and having a tough time of it.

If I follow the tutorial as linked above, everything works until I run the app, at which time I get the error:

02-29 15:25:00.542 14116-14116/local.test.t1 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.

Googling this, I find that I need to register with Google somehow (but not mentioned anywhere in Google's tutorial).

I eventually end up at Accessing Google APIs, a separate tutorial from Google where it says:

Note: Before making calls to specific Google services, you may first need to register your app in the Google Developer Console. For instructions, refer to the appropriate getting started guide for the API you're using, such as Google Drive or Google Sign-In.

but has no specific information for if I just want to use location services. I go there anyway and find I need to get a configuration file where I need to generate an SHA-1 which then points me to this link for generating it at which point I'm now stumped. It says:

To get the release certificate fingerprint:

keytool -exportcert -list -v \
-alias <your-key-name> -keystore <path-to-production-keystore>

What is this path-to-production-keystore that I am supposed to point to? It gives no further information. It does give an actual command for a debug fingerprint but says I should get both release and debug.

Can someone please tell me if I'm going down the wrong rabbit hole, or if it is the right one, what is the proper next step?

Ana
  • 11,726
  • 5
  • 49
  • 101
  • You shouldn't need any of that for the fused location provider. I don't have that in [either of these projects](https://github.com/commonsguy/cw-omnibus/tree/master/Location), and they worked fine a few months ago. I even just tried it with `8.4.0` of `play-services-location`, and the app works fine without any of that. – CommonsWare Feb 29 '16 at 23:40

2 Answers2

0

I had huge trouble with getting Google Play Services to work, as well. Considering that you're using Android Studio you can try this to get the SHA1-key:

  1. Open Android Studio
  2. On the right side press: Gradle
  3. Go to Tasks->Android
  4. Double click signingReport

You'll see you code in the bottom 'Run'-Tab

Found here: SHA-1 fingerprint of keystore certificate

Community
  • 1
  • 1
alektron
  • 75
  • 10
0

Try this You need to generate a key from google developers console and enable all related api to use in your application Refer here for more details :- http://coderzpassion.com/android-location-using-google-play-services/

Jagjit Singh
  • 1,711
  • 11
  • 17