In my project google map showing and everything working fine when i run code directly from eclipse or android studio, but map showing white screen when i make a signed apk and install my device.
Have anyone idea what can be the issue ?
When you make a signed APK, you have to generate a new API key for the Google Map and update it in the API console. The API key used with the debug APK will not work.
Check your logcat, it probably shows an Authorization Failure message.
When you generate signed apk, at last step you get a SHA1 key.copy this key and go to google api console,click API and Auth on left side of screen ->Credential ->create new key->Android Key-> paste SHA1 key that you copied from apk generation screen and after SHA1 key place samicolon";" and your app package name.
It will generate new api key,use it in manifest and run your app.it will display your map.
Related
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.
Google maps v2 is implemented in my app. It works fine when it is run with other computer.
But it is not showing Map when Apk is generated with my computer.
Is there any settings to change in my PC?. Please suggest me.
Google maps API key is generated with Signed key.
You are absolutely right you do not need to change the api key it is unique.
So you don't need to change anything in manifest.xml.
But, As you said when you run the project from your computer it does not showing the map. Because when you run the project by default it sign the apk with debug.keystore.
So now what you have to do is, just generate the SHA-1 from your pc using debug.keystore and make entry of that SHA-1 in google api console.
You can add multiple SHA-1 in your project settings at google api console.
Just see the screenshot you will got the idea.
when you run form your computer then debug.keystore used and when you create apk then keystore is change and also SH1 key is changed so your map is not show when you create apk.
Solution: create new api key for apk, use this key when you create apk. this link help you to get SH1 key from keystore
I have an application on the playstore that uses maps. Although it worked fine in debug, map doesn't appears in realease.
I did the following steps:
- activate maps v2 on google console
- get the API key
- paste the API key in my manifest
- export the apt file with eclipse tool to generate and sign
It's happen because your given SH1 fingerprint signature does not match with your app's SH1 . When you have get API Key from API console you enter the SH1;package_name_of_your_app this SH1 is not the exact SH1 for your APP. For this reason map is not showing.
This is happen for me also. If any thing need please ask me.
Edited Answer
You will get this type of thing
When exporting in Eclipse like that, you will see a SHA1 signature for the release app. Use that one to create a new key, and add it instead. Then continue, as usual. The problem is that you have to have different keys for release and debug. Not sure where exactly was this written, but this should be enough as a source I think.
I have a problem with Google Maps api v2 on my android app.
I have generated the key for the debug certificate and everything works fine, but I can't make it work with the release certificate.
I've generated the key and the alias with eclipse, then I took the SHA1 which eclipse shows at the end of the "Export signed application" process.
Then I generated the api key for android apps in my google api console using
SHA1;package name
But it doesn't work... it works only with the debug key generated in the same way, only using the sha1 of the debug certificate!
Please help me, otherwise I can't release my app
Check your manifest file, I guess you've forgotten to set your release map api key there while exporting with your release key?
Me too faced the same problem during releasing my app to google Play, when I used Google Maps V2 in my app. After succeeding the issue, I wrote a blog post regarding this you can have a look.
As everyone requested, I would say the answer in following steps
1) Sign up your app using eclipse adt
2) Note down the SHA1 finger print which will be displayed at console of your eclipse adt
3) Again go to google console and get API_KEY for your app by using above got SHA1 fingerprint
4) Replace the old API_KEY with the new API_KEY on to manifest.xml of your app
5) Again sign up your app. Your app is ready to be published. But keep in mind that once you published your app to google market, you should be able to release updates to your app by signing .apk using the keystore which you used earlier for release.
Hope this helps ...
There are two files google maps api.xml, one is the debug and release the other, then you should replace the key generated on google website console and enter this file, another outlet is inserted directly into the manifest.
I'm having a serious problem
When i build the apk via Eclipse everithing fine and the map is working very well
But when i sign my apk with Eclipse and move the signed apk to my phone the map activity not working, its not collapse it just show gray screen
I don't know what im doing wrong
I made all by using guides and i think everithing is fine
Does it happens to somebody that can help me solve this problem?
I pass the dead line that i should upload my app and i'm really nervous
Please help me.
Thanks for all answers
The maps api key is based on the keystore sha1 hash and the package name. When you sign your apk, the sha1 hash changes (because you are signing with a different keystore).
Just add the sha1 hash of the new keystore, and the package name to a new line in the Key for Android apps (with certificates) section, under the API Access section in the Google Api Console. It's exlained here as well: https://developers.google.com/maps/documentation/android/start.
use your debug keystore to sign the apk or else you have genreate new api key with the sha1 the keystore which you want to export the project.