Reputation: 1598
I am trying to get my Google Maps to display on my app, but it is not working and this error appears:
01-25 11:38:54.763: E/Google Maps Android API(30514): Authorization failure.
I am currently using the SHA1 certificate fingerprint from the release certificate that was used to publish my app on the appstore.
Edit: I have also switched on the Google Map Android API v2 on the API Console.
I've read from the comments from here that "Signature Algorithm MUST be SHA1withRSA and NOT SHA256withRSA". However, I created the release certificate from Eclipse and it is SHA256withRSA, and I didn't do any settings to it. I can't seem to change it either.
Can someone enlighten me if the signature algorithm is causing the problem? If so, how should I be changing the signature algorithm on eclipse?
Upvotes: 3
Views: 4599
Reputation: 1087
Check your API Key exists or not with the appropriate SHA, if not regenerate it with the appropriate SHA. If you don't know how to generate it, try it below:
JAVA_HOME\bin > keytool -list -v -alias androiddebugkey -keystore "~\.android\debug.keystore" -storepass password(your_own) -keypass "password(your_own)"
Check manifest file, if you written two meta tags like this
<!--<meta-data-->
<!--android:name="com.google.android.maps.v2.API_KEY"-->
<!--android:value="AIzaSyBHghWPWutTiOxCJKll2WoCuVOQ5YotLiY" />-->
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_maps_key"/>
Comment any one among them, for my Project used geo.API_Key
, it will handle both GEO and Google Maps.
More importantly import google-services.json file in to your app folder.
Upvotes: 0
Reputation: 1598
Figured out my problem.
I've been generating keys from my release certificate, which WILL NOT WORK during debugging when I run the app on my phone. I have to use the debugging keystore certificate fingerprint instead.
Please remember to keep 2 keys:
Debug API key from your debugging keystore when you run it on your phone.
Release cert API key to be used when you want to sign the app just before deployment to Google Play Store.
Upvotes: 4
Reputation: 23638
Please check that you have enabled the Google Maps Android API v2
in your google api console.
Upvotes: 0