0

I've created my own keystore using this command from d.android:

$ keytool -genkey -v -keystore my-release-key.keystore
-alias my_alias -keyalg RSA -keysize 2048 -validity 10000

Next I've found SHA1 using: keytool -list -v -keystore my-release-keystore It was right after SHA1: ....

The in my app i have com.mypackagename.MyClassName

In the API Access of Google Api Console I've pasted the following:

MY_SHA1;com.mypackagename

And it was successfully added.

But when I am launching my app on the device I still have grey tile instead of map. Although in

<application android:label="@string/app_name" android:icon="@drawable/ic_launcher">
    <meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="value_taken_from_Api_key_field_in_google_console">

And in fragment for map I also have pasted:

<fragment
        android:id="@+id/map"
        android:name="com.google.android.gms.maps.SupportMapFragment"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:apiKey="value_taken_from_Api_key_field_in_google_console">
</fragment>

When I run my app straight from IDE using my device instead of emulator it shows grey screen (zoom buttons and "Google" label are shown). Also when I create .apk using mentioned keystore with my_alias then this .apk also shows grey screen instead of map (zoom buttons and "Google" label are also shown).

  • Daniel's advice might be helping: http://stackoverflow.com/questions/30559602/android-studio-google-map-still-blank-on-real-android-device/30559898#30559898 – morganzd May 31 '15 at 17:15

3 Answers3

0

I personally had that problem once, seems my keytool wasnt working that great. I know that eclipse has a function that shows your SHA1, which was different(and working) for me. It's at Window>Preferences>Android>Build. See if that one is different if you use eclipse. Also, did you set the correct permissions, meta data(also google play services versions), glEs and such things, as shown in the google maps getting started walkthrough? I also dont think the android:apiKey is needed in your map fragment, since it is set in the manifest.

Matthijs
  • 71
  • 8
  • Oh... I use Intellij Idea 13. Do you know where I can find this? Google shows me nothing for that at now... And as for the manifest - yes I've added: "android.permission.INTERNET" "android.permission.ACCESS_NETWORK_STATE" "android.permission.WRITE_EXTERNAL_STORAGE" "com.google.android.providers.gsf.permission.READ_GSERVICES" "android.permission.ACCESS_COARSE_LOCATION" "android.permission.ACCESS_FINE_LOCATION"> – user2783834 Jun 25 '14 at 20:00
  • Sorry, I don't know where to find it in there. There probably is such a function in there though.. don't see a preferences window somewhere? – Matthijs Jun 25 '14 at 20:15
  • I fixed the problem. And it was because I have 64bit laptop and I used 32bit Win7. Now I have 64bit Win7 and it works fine! – user2783834 Jul 07 '14 at 08:52
0

I would create a new debug API key using the debug keystore. On Windows you can find the debug keystore at: C:\Users\YOUR_USER_NAME\.android\debug.keystore

Use the SHA1 from that keystore and generate a new API key. You should then be able to see the map when you run your app from the IDE onto you device.

todd
  • 1,266
  • 1
  • 13
  • 20
0

I fixed the problem. And it was because I have 64bit laptop and I used 32bit Win7. Now I have 64bit Win7 and it works fine!