Google Maps Api don't work when uploaded - android

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.

Related

Difficulty in Obtaining an API key for Google Maps

I am following the instructions in this tutorial https://web.stanford.edu/class/cs193a/lectures/maps.pdf
I get the command prompt to C:\Users\USERNAME.android (for windows new)
I then type >keytool -list -v -keystore debug.keystore
but when I press Enter I get:
What is going wrong? It seems like I have not set something up quite correctly, because I have followed the instructions which didnt seem difficult.
1. Open Terminal In Android Studio you are running.
2. Enter: keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
3. Copy SHA1 key.
4. Go To Google developer console and select Android API Key.
5. Copy SHA1 key to android Fingerprint and Write Package in Package Name block.
6. Generate API key.
7. USE API key

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".

Invalid fingerprint for generating Google Map key for android application

I have successfully generated the fingerprint Certificate for google map key by using these command
keytool -list -alias androiddebugkey -keystore "C:\Users\pc\.android
\debug.keystore" -storepass android -keypass android
and i got this result
androiddebugkey, Aug 25, 2012, PrivateKeyEntry,
Certificate fingerprint (SHA1): 68:1F:B8:80:C0:B9:96:D1:6E:95:86:69:CD:DB:0E:28:DC:9E:89:51
when i try to register Certificate fingerprint on this site https://developers.google.com/android/maps-api-signup
page replied me The fingerprint you entered is not valid. Please press the Back button on your browser and enter a valid certificate fingerprint
where is problem please help.
I find the solution of my problem just changed the command by this
keytool -list -v -alias androiddebugkey -keystore C:\Users\<user>\.android\debug.keystore -storepass android -keypass android
If your having issues finding the debug key path or dont want to use the adb you can get the fingerprint in eclipse:
go to window-->preferences and find the android section. Select the build sub-setting.
for the production fingerprint when your exporting your signed application using ADT right before you click finish the hash will be there. just copy it.

Obtaining Google Maps API key

I'm using Windows 7.
I have tried several times with the debug.keystore with appears in c:\users\YOURUSER.android\ using the command:
keytool -list -alias androiddebugkey -keystore c:\Users\YOURUSER\.android\debug.keystore -storepass android -keypass android
It gives me a MD5, but then I go to Google MD5 registration page and it sais it is not a valid fingerprint.
I searched for more information, and I finally created a new debug.keystore into c:\users\YOURUSER\ to avoid rewriting the original one. I used this command:
keytool -genkey -keypass android -keystore c:\users\YOURUSER\debug.keystore -alias androiddebugkey -storepass android -validity 10000 -dname "CN=Android Debug,O=Android,C=US"
It works, so I use the previous command to get the MD5, and it gives me a new MD5. Then I go to Google again and the same problem: "not a valid fingerprint".
The I made a second attempt. This is what I did then:
1) Opened a Windows7 terminal, went to c:\program files\java\jdk1.7.0\bin\
2) Wrote command:
keytool -genkey -v -keystore c:\eclipse\my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
3) Then I tried to get the MD5 code from my keystore, using comand:
keytool -list -alias alias_name -keystore c:\eclipse\my-release-key.keystore
and writing the password I am asked. It gives me a MD5.
4) I go to maps api key sign up and write the MD5. "FINGERPRINT NOT VALID"
I don't know what the problem is. And I am supposed to do this for every app I program? What a headache!
Can anybody help me please?
Are you sure you get the MD5 and not the SHA1 fingerprint? Tryed the -v option?
see: How can I get the MD5 fingerprint from Java's keytool, not only SHA-1?
google maps has deprecated its previous version API v1 and introduced a new version of google maps API v2.
previously we generated md5 key but now we need to generate sha-1 fingerprint certificate.
The Maps API key is based on a short form of your application's digital certificate, known as its SHA-1 fingerprint. The fingerprint is a unique text string generated from the commonly-used SHA-1 hashing algorithm. Because the fingerprint is itself unique, Google Maps uses it as a way to identify your application.
please go through the links it could help you
https://developers.google.com/maps/documentation/android/start#the_google_maps_api_key
https://developers.google.com/maps/documentation/android/intro#sample_code
also see the same kind of post in stack over flow
How to implement Google Maps new version of API v2
In command line you need to open Java-> jdk-> bin
as for me it is "C:\Program Files\Java\jdk1.7.0_03\bin"
There is "keytool" program which u need. In command line enter "cd C:\Program Files\Java\jdk1.7.0_03\bin"
And enter "keytool -list -v -keystore C:\Users\John\.android\debug.keystore"
So the final string in command line must look like:
"C:\Program Files\Java\jdk1.7.0_03\bin>keytool -list -v -keystore C:\Users\John\.android\debug.keystore". Whare usually u need only to change the name "John"
There will be SHA-1, MD5, etc
Finally, go to Google Access API google access api

Categories

Resources