Android google map API key not running in release - android

I have an application with a Google Maps in the center. However while programming and debugging it all worked fine. Now we created a release application and we found out the current API key is not working.
Now I created a SHA1 key and added my package name to it inside the developer console. It generated a key for me, however this key isn't working either in a release apk.
I tried several things like regenerate it a few times or reinstall the app.
Anyone know what might go wrong?

Make sure you're creating your SHA from the key that you're signing the application with. This SHA will be different than the one that you use for the debug builds.
Make sure that the application is actually getting signed correctly.
Make sure that the package you're providing for the key is correct.

Related

My app that uses Maps API doesn't work if downloaded from Google Play

Okay, so here is my problem:
I made a little app for myself that uses the Maps API from Google. I followed the instructions on how to put the API key in the app and all that. I make my app, run it on my phone (via USB debugging if that's important) and it works just fine. Now, out of fun, I put the app on Google Play Store (for some of my friends and family to use it idk), and all of a sudden, the app doesn't work. What happened was, the map wouldn't load (as if i haven't put in the API key). Then I uninstalled the app, tried running it with USB debugging again, and the same thing happened. So I put in the new API key, and it works just fine. Uploaded the version 2 in the Play Store, same problem and the same situation. How do I fix this?
I will provide any additional information that you need.
Check if you've entered your API key within the google_maps_api.xml file in the release directory (/app/src/release/res/values) just like in your debug directory (/app/src/main/debug/values).
Then, if you have API key restrictions make sure that you are using right certificates for the debug and release builds. You can get your debug and release certificates by following the steps given on Google Maps SDK for Android documentation
I hope this helps! Goodluck on your project

Android Studio Signed APK for Google Map API v2

I know this question was already ask 100, 1000-times, but still I have a problem with it and I already tried a lot by signing the application and to visualize the map after putting them in the store.
What I actually want is the following: Putting the android application in the store under "Alpha" version. This works without a problem, the application works, the only thing that doesn't work is the google map, its a white screen, I think the problem is that there is something wrong with the signed api key, but I don't know what.
Firstly I did the keystore with this dialog.
Afterwards I generate the SHA1 value for the google map api key with this new keystore. Putting the SHA1 value into the console.developers.google.com link under credentials to generate a PUBLIC API ACCESS key under the following format: XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX;PPP.PPPPP and then I generate a key and copied this in the manifest file.
And finally I either generated a signed apk for the store or directly signed it by building it for the smartphone.
But still it doesn't work. I don't know what the problem could be... Maybe one of you can help me.
OK guys thanks for your help I found the error... Don't know how it came to this error but still I found it.
As you may know android studio will generate you an google_maps_api.xml file. When I opened the file there was the key written "ALZ...." but when I check in the multi languages place, there was written "YOUR_KEY_HERE", so something went wrong... After putting the key in the multi language place it worked :)
I had a similar problem (since the key generation was device specific). I don't know whether its the best answer or not but following solved my problem:In Google Developer Console(after creating project and enabling apis), I generated a browser key without entering any ip and used that as my key.That solved my issue.

How to check if my Android release.keystore is correct?

I received a release.keystore from the developer that was working previously on the project.
I created a custom debug.keystore based on release.keystore to test the app.
Some of the functionality of the app is broken comparing to the app on the Google Play which makes me think I might not have a valid key. For example Maps don't display correctly (gray square).
Is there a way to find out if I have a right key, that the previous app was uploaded with?
thank you!
don't create a debug key from it. Just sign the app with the regular key and then test it.
I believe that the maps API is tied to your release key so it will not work in your app unless you sign with your release key

md5 generated code not showing google maps any more

I'm having a problem. I had a debug md5 code that was generated. I switched the code so I can publish my app, I now get a grey screen when i run my emulator. The map doesn't show up any more. Is this a problem? should i trying getting another md5 code to use? Or can the debug code work?
You must generate another API code. Your Google Maps API code is generated based on the keys your app is signed with, therefore if you sign your app with release keys, you must generate an API code which is generated using the same release key.

Does a new Debug Keystore mean a new Map API Key?

I just deleted my Debug.keystore because an application displayed an error on the project file which I couldn't find. After deleting the keystone my app works fine except the fact that the map doesn't display at all - only the blank grey boxes that precede the loading of the map.
Does this mean I have to get a brand new Map API key because the application signature has changed?
P.S. The app worked fine before this therefore I have all required uses-library permissions etc.
Thanks
EDIT
After some snooping about I have answered my own question but when i tried to get a new API key it tells me that the Keystore File doesn't exist. I thought that when it gets deleted another one is rebuild/recreated automatically. What gives?
There is a debug keystore and a keystore for your signed app. The keystore file is in the hidden .android directory (on a Mac, inside the user directory).
Google Maps only works with a SIGNED APK. The debug keystore is not relevant then.
Create a signed APK. Make very, very sure to make backups of that keystore you create for this APK; you can't publish updates to the Android Market unless they're signed using the same keystore.
Generate your hash from that keystore file, get your API key, and use that in the app.
Even then, if you just run your app straight from Eclipse, you will not see the map, only the gray area... you must load the signed APK onto your phone, install from that, and then it should work. Hope this helps!
Does this mean I have to get a brand new Map API key because the application signature has changed?
Yes. You used an MD5 fingerprint of your original signing key to get the Map API key. You will need to follow the same steps to register a new MD5 fingerprint and get the corresponding Map API key.
After some snooping about I have answered my own question but when i tried to get a new API key it tells me that the Keystore File doesn't exist. I thought that when it gets deleted another one is rebuild/recreated automatically.
It will be on your next build. Make sure you are looking in the right place.

Categories

Resources