Android Google Maps grey screen after publishing apk on play store - android

I made an Android app that uses Google Maps API to display a map.
When I run it with android studio it works fine. However after I publish it on the play store and download it from there all the maps show up as just grey screens.
I registered a key on google development console with both the debug SHA-1 key, which I got through this command:
keytool -list -v -keystore "%USERPROFILE%.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
And the release SHA-1 key which I got with this command:
keytool -list -v -keystore [my\keystore\path] -alias [releaseAlias] -storepass [storepass] -keypass [keypass]
I've also unzipped my release APK and checked it with this command:
keytool -printcert -file CERT.RSA
And it shows the same SHA-1 key as the release key above.
Am I still getting the SHA-1 key for release incorrectly? Is there another way to get and verify it?
EDIT: I found the problem. It was like the top reply in Android SHA1 release keystore not working with Google Maps said. There were two google_maps_api.xml files, one in debug and one in release and android studio only showed the debug one. Manually editing the release xml to add the key fixe it.

Related

Google Maps Api don't work when uploaded

My application does not work when I upload it to the play store. It works fine when installing it from android studio.
Is there something special that's need to be done with the api key?
In windows this would be the command to get SHA1 key
Open a terminal window.
​
cd C:\Program Files\Java\jdk1.7.0_05\bin
Next we have to run the keytool.exe. Use the following line to get the Android SHA1 fingerprint.
​(PRODUCTION KEYSTORE) keytool -exportcert -alias keystore -keystore "C:\Users\myusername\Documents\AndroidKeystore\androidkestore.jks" -list -v​
​(DEBUG KEYSTORE:)​
keytool -list -v -keystore "%USERPROFILE%.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android​
Note the third point where keystore for production is retrieved. You need to add this value into your developer console as shown below
Go to your Google Api Console -->> Select your Project --> Go to Credential --> Click on Api key you generated.
Here you can check the packageName And your SHA 1 check if eveythign is proper.(you have submitted correct SHA1)
And It should work.

When I deploy my xamarin forms app inside my project I see the map, but when I put it up on google play the map is not loading

Followed some guides but I cannot get it quite right. I will show you the process below that does not make it quite work.
First of all I started off by acquiring an API-key on google console and i put that into my project.
I acquired the sha 1 by typing this into the terminal:
keytool -list -v -keystore ~/.local/share/Xamarin/Mono\ for\ Android/debug.keystore -alias androiddebugkey -storepass android -keypass android
The map now runs smoothly and fine in my xamarin project when I run it on my device.
Then when I try to upload the project I create a keystore named: "myproject.keystore" and I give it the Alias and password: "myproject" as well.
Just like this:
$ keytool -genkey -v -keystore myproject.keystore -alias myproject -keyalg RSA -keysize 2048 -validity 10000
When I now upload the app to google play and it gets accepted I cannot see the map.
Try comparing your project settings between DEBUG and RELEASE to find a difference. Or check for any hard coded API keys or anything that that would be different between the two environments.
Edit:
So after your myproject.keystore is created, you need to extract the SHA-1 from that keystore and add that to the Credential list in Google.
So if you created your myproject.keystore in ~/Users/Someone/Desktop/, then you would extract the keystore the same way you did with the DEBUG version:
keytool -list -v -keystore ~/Users/Someone/Desktop/myproject.keystore
That should give you the second SHA-1 that you need to add to the Google site.

Google maps v2 not work from google play

I have an app with maps, and it work well. But after I publish it at google play, the map not display.
Once I've put applications with a map to the store, and everything was fine.
Now I get sha1 for my key, and put it at google developer console, and try all the answers about it.
So I think that something was changed.
Any idea?
Here is the steps how to generate Google Map V2 API Key for Release Mode.
If you work on Windows 7 then
Open your command prompt and go to C:\Program Files (x86)\Java\jre7\bin (Where your JRE installed)
Now generate your own keystore first by using below command
keytool -genkey -v -keystore keystore demokeystore.keystore -alias YouraliasName -keyalg RSA -keysize 2048 -validity 1000000
Now if you see the demokeystore.keystore file is created in C:\Program Files (x86)\Java\jre7\bin folder
Now time to generate SHA-1 by using this demokeystore.keystore by using below command
keytool -list -v -keystore demokeystore.keystore -alias YouraliasName -storepass yourPassword -keypass yourkeyPassword
Now at last step pick up new SHA-1 and generate new API key from console and also add(Register) key in your project manifest.xml
Also built the .apk from the same keystore for play store.
I found the problem.
There is 2 files with google_api_key, one for release and one for debug. I forget to change the one for release...

Google map reporting invalid key in Android

I got the SHA-1 fingerprint from using the keytool for my application on my key that I sign the application with when I upload it to the play store.
But when I open the app on my phone for testing it says it is not the right key. ANy ideas what I could be doing wrong?
Not sure what more information i can give without giving security info for my app, so if you can help give me anymore information that I can not think of please let me help you help me.
First for the development generate a SHA-1 from debug.keystore:
Navigate to C:\Program Files\Java\jdk1.6.0\bin>..... where your bin located then execute below command
C:\Program Files\Java\jdk1.6.0\bin>keytool -v -list -alias androiddebugkey -keystore "D
:debug.keystore" -storepass android -keypass android
or
C:\Program Files\Java\jdk1.6.0\bin>keytool -v -list -alias androiddebugkey -keystore "C:\Documents and Settings\user1\.android\debug.keystore" -storepass android -keypass android
Now, you can get one SHA-1 certificate and generate API key from Google API console. Add this key into your manifest.xml file. remember this API key only for the development. Using this key built apk u can not publish into market.
Now, turn to make your own keystore: execute below command
C:\Program Files\Java\jdk1.6.0\bin>keytool -genkey -v -keystore OWN.keystor
e -alias ALIASNAME -keyalg RSA -keysize 2048 -validity 300000
and give all the required details for this keystore. Now time to generate SHA-1 from your OWN.keystore execute below commnad
C:\Program Files\Java\jdk1.6.0\bin>keytool -v -list -alias ALIASNAME -keystore "C:\Program Files\Java\jdk1.6.0\bin\OWN.keystore" -storepass PASSWORD -keypass KEYPASSWORD
Now, you can get one SHA-1 certificate and generate API key from Google API console. Replace this key into your manifest.xml file. Now your app is ready to publish into market.
This may helpful to you.
Have you tried to completely remove the application and then install it all over again. This key might be got cached and even if you install the application with new key.
So before you install your application with the new key, try to remove the application completely from the phone.
You can as well go over this blog post I wrote and make sure you do all the steps right in producing the key:
Google Maps API V2 Key

How to create release key for android v2 maps

I tried below code for a debug key and its working fine. When i make a apk then map is crashing. After searching in google i found debug key is work in release mode.
keytool -list -v -keystore "C:\Users\your_user_name\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
So,how can i create a release key for v2 maps. please help me.
I didn't had the chance of doing that, but for my understanding what should be done is:
1. First of all you will need to export you project as a Signed Application:
Right click your project -> Android Tools -> Export Signed Application Package...
This will take you through wizard where you would have to create a new release.keystore with a password or use an existing one you created before.
2. From this point on the process should be identical to the one where you use the debug.keystore.
3. All the steps of creating a debug api key and registering it in Google API Console are described at this blog post I wrote:
Google Maps API V2 Key
4. Just remember that using the debug.keystore will not give you desired result.
Tyr this..
your directory where you have installed java and go to the bin folder.
For example-
C:\Program Files\Java\jdk_your_version\bin>keytool -list -v -keystore C:\Users\your_user_name\.a
ndroid\debug.keystore -storepass android -keypass android
i think it might help you.
C:\Program Files\Java\jdk_your_version\bin>keytool.exe -list -v -alias androiddebugkey -keystore C:\Users\your_user_name\.android\(Application).keystore -storepass YOUR_STORE_PASSWORD -keypass KEY_PASSWORD
Generally YOUR_STORE_PASSWORD and KEY_PASSWORD are same is "android".

Categories

Resources