I am creating a new Maps Activity using Android Studio and following all steps, with adding an API_KEY, to manifest, enabling Android Maps API in Google console, and restricting it to my package and SHA1. I have searched all internet and tried many things, but the Map is still blank.
Can anyone help?
Blank screen means you have problem about Google Maps API signing.
Probably you have created a new keystore file and used its SHA for enabling maps API.
But while you are developing all your runs are signed with debug.keystore which is default unless you declare one.
You can use your keystore file that created by you for debug runs from signing configs in Project Settings from Android Studio.
Good luck
Emre
Related
I have some issue that I have been searching without solution. I had have an app with Google Maps working well, but I deleted the project on console.developers.google.com by mistake, then the app stops to show the map.
I created another project on the console, I generated other api key with Google Maps for Android enabled. Then I changed my google_maps_api.xml value, I cleaned the project, then re-build and created a signed apk, but when install the app the maps not shows it.
I already tried this:
Change to "None restriction" for the key and wait for 24 hours.
I changed the XML attribute to templateMergeStrategy="replace".
Shutdown and turn on my smartphone.
Uninstall and install again my app.
Nothings works
You just declare your google map API key in the debug mode. There is one more google_map_api.xml file in the release folder. It should be like this, just copy/paste your api key.
P/s: Don't forget to switch your Build Variants to release before build signed apk
I had outsourced an application which has google maps in it.The developer gave me apk which works fine and google map is also displayed.But when i run the source code in android studio google map is not visible.In manifest there are two api_keys debug and release.I commented the debug key and generated signed apk ,but still the map is not visible.Is the issue related with signing of app?
I developed an Android app in intel-XDK using Google Maps Android API key. This works fine in dev and testing on devices. I built the app with the same key in code, jarsigned with my keystore, zip aligned, and published at the Playstore. The Map is NOT appearing in the Product. invalidkey or unauthorisedurl . I pasted the cert SHA1 in dev console for api key too. Googling here and elsewhere for a solution I am still unable to bring the Map on product in Playstore. How should I create the correct key for production ? especially in XDK. Anything missing in my build settings ?
In my android app I am using google map and location services.So I generated API key on google developer console for my development work using SHA1 generated by making use of debug.keystore.It worked fine and google map worked perfectly. When I had to release the apk I signed apk following instructions at http://developer.android.com/tools/publishing/app-signing.html#studio.
When I tried to beta test the app, google map didn't work.Visiting the forums told me that I need to generate another google console API key using SHA1 generated by using keysotore which was created while signing the apk.I did same and replaced the key in androidmanifest.xml(So now my project on google console has two API keys,older one I used for development,and newly created one ). But when I regenerated apk and tried to run it on my personal device from android studio, map didn't work.Moreover when I replaced new key by old debug version of key in manifest file and tried to rerun app on my android device map still don't work.So now my older key is also not working while it was working fine before all these changes.
Please help me in this regard.
You should be using the same API Key for your applications but you need to add both the debug and release credentials.
So you will end up with two entries in the android applications:
99:88:77:66:55:44:33:22:11:04:76:99:C3:2A:52:71:7C:64:EC:8B;com.package.app
99:88:77:66:55:44:33:22:11:1C:CC:33:D7:74:A2:49:5D:7D:BF:C6;com.package.app
You can refer to this question for help with the process of adding credentials for each keystore.
In my app, I use maps to show the current position. Then, I use Google Maps Android API v2 (I don’t use Google Maps API) to add this functionality to my app.
When I am developing my app in eclipse everything is OK. I create an Android key with the debug keystore and I use it in the manifest, I can execute my app well and I can move and use the map. In this case I have no log errors (only the typical “The Google Play services resources were not found. Check your project configuration to ensure that the resources are included”).
Now when I upload my app to the Google Play Developer Console, in beta testing it works, but when I go publish, the map gets grey background and doesn’t work. Log gives me this error:
09-23 14:05:46.475: E/Google Maps Android API(5485): Authorization failure. Please see https://developers.google.com/maps/documentation/android/start for how to correctly set up the map.
09-23 14:05:46.475: E/Google Maps Android API(5485): Ensure that the following correspond to what is in the API Console: Package Name: gc.yy.xxxx, API Key: AIza*******************************RDEI, Certificate Fingerprint: 472D********************************7218 (keystore use to sign the package)
Then I decide to use in my eclipse project that keystore, so I create a new Android key (47:2D:*************************:72:18;gc.yy.xxxx gives me AIza*****************Qm4Q key) and I paste it in the manifest file. I run the project and I get once again the grey background. Log gives me this error:
09-23 14:10:45.307: E/Google Maps Android API(5585): Authorization failure. Please see https://developers.google.com/maps/documentation/android/start for how to correctly set up the map.
09-23 14:10:45.317: E/Google Maps Android API(5585): Ensure that the following correspond to what is in the API Console: Package Name: gc.yy.xxxx, API Key: AIza*******************************Qm4Q, Certificate Fingerprint: CC4B********************************A917 (debug keystore)
I don’t know if the problems concerns to the keystore. I use debug.keystore with my map (I can’t use another one, I don’t know if it’s not possible) and I use a keystore I create to sign my app package. It seems an infinite loop of no useful API keys…
Thanks in advance!
EDIT: I finally solved it by adding the 2 meta-data blocks of each API key, that is to say, my manifest was like this:
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIza*******************************RDEI" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIza*******************************Qm4Q" />
And finally, I have my app in Google Play! :)
You need to register your non-debug keystore to the google maps API via the Google API console
I used two different api keys (one for development, one for the release). At the end: that's stupid, since you can have several app hashes attached to one key. Hence that's the solution, just added on code.google.com/apis/console the release hash to the development api key (for backwards compatibility) and the development hash to the release api key (for easier development).