Hayya ANAM
Hayya ANAM

Reputation: 575

Google map shows on emulator but doesn't show on device

i m using my google map applictaion and get google map api key
"0o8CRg5BhPmqQB1pvyYZQNfJ2ZbpDMa6XFunRwA" i use this same key to sign in my application but problem is map show on emulator but not show on my HTC wildfire S device tell me what is the problem??

Upvotes: 2

Views: 1627

Answers (5)

Dmila Ram
Dmila Ram

Reputation: 1074

you have to add SHA-1 certificate fingerprint associated with your releaseKey.jks (used to sign apk) to your map api key:

  • open terminal
  • suppose your releaseKey.jks locates at: /Users/macbook/Downloads/Files/releaseKey.jks and your releaseKey.jks 's alias name is demilaram, open terminal and type:

    keytool -list -v -keystore /Users/macbook/Downloads/Files/releaseKey.jks -alias demilaram

  • copy SHA1 and navigate to Google Console and open your api key then add finger print and package name. under column named "SHA-1 certificate fingerprint" paste SHA1 and under column named as "Package name" enter your package name.

  • hit save and after a while (probably 10 minutes) you'll be able to see map on your device which has a release mode apk installed on.

Upvotes: 0

Hayya ANAM
Hayya ANAM

Reputation: 575

use this link

C:\Program Files\Java\jdk1.6.0_20\bin> keytool -list -alias androiddebugkey -keystore "C:\Documents and Settings\Nazeer.android\AndroidGoogleMaps.keystore" -storepass android -keypass android

Upvotes: 0

varevarao
varevarao

Reputation: 2186

A point to note is that (if debugging) you should have a separate debug-key generated for each of the machines you're using to install your app from. Only once you plan to release your app is when you can refer to @Thomas' answer and generate a release key.

In the meantime to locate any api-key related problem just check your Logcat output for java.io.IOException: Server returned: 3, which would mean the debug key you used is not valid for the machine you've installed the app from.

Upvotes: 0

Sreedev
Sreedev

Reputation: 6653

This can happen for many cases you can try out the list of cases below which may solve this

  • Try switching on WiFi Gps or data exchange for the internet access
  • Check the location bases settings and switch on everything related for access location for the app.Settings>Location>SwitchOn...
  • Check all the permission in manifest.Internet,Access_fine_location, Access_coarse_location
  • Check the generated key for the map.
  • Check whether the network has a good speed to fetch the map.

Upvotes: 2

Thomas
Thomas

Reputation: 1563

Most likely the API key you're using isn't associated with the one you're signing you application with.

You will need to use another API Key which is associated with your production certificate - the one that you sign your APK with - and not the debug key.

Try to use this guide instead of the one from SDK Debug Certificate

Upvotes: 1

Related Questions