Android google map blank

1) Created a new project.

2) The selected google map is created.

3) Debugging the following google_maps_api.xml steps.

4) Release the following google_maps_api.xml steps.

  • developers.google.com/maps/documentation/android/signup.

  • keytool -list -keystore your_keystore_name

  • keytool -list -v -keystore your_keystore_name -alias your_alias_name

  • SHA1:: 0D:: 74: D3:: E1: 43:: 71 :: 62: 90 :: A1: 66: 6E: __: 5D: 75 added

  • The Google Developer Console API Key has been created.

  • <string name="google_maps_key" templateMergeStrategy="preserve" translatable="false"> AIzaSyB3d_usre_Joj_TrgP3aKtdkrSt_tTeqGI </string>

    another release key added.

5) AndroidManifest.xml

  • <meta-data android:name="com.google.android.geo.API_KEY" android:value="@string/google_maps_key" />

  • <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

6) Create a signed APK, a build version of the assembly type release.

7) Beta version published in the play store.

8) Blank screen of google map.

9) But the local google map application is working fine.

10) All package names are correctly added to the Google Developer Console.

+5
source share
3 answers

I suggest this may be due to SHA 1 fingerprint mismatch. Double check that you are using the same keystore to receive SHA1 and apk releases.

or Check if your API key is valid or not. To do this, add the following MAP_API as the release key

 AIzaSyDztCvpv3PVBxzWwY7mWqCMnGfDeOiGxwY 

Add the following to your AndroidManifest.xml (optional / optional)

  <permission android:name="your_pakage_name.permission.MAPS_RECEIVE" android:protectionLevel="signature" /> 

Build your version of apk. And test it.

If a map is displayed, we can fix that your API key is a problem.

Get Sha1 again and upgrade your Google Developer Console.

+3
source

You generate SHA-1 in cmd. Sometimes cmd returns a local SHA-1 rather than an administrator. So try creating SHA-1 from Android Studio. follow the steps to generate SHA-1:

  • Click Gradle (right pane of the studio where the Preview option is displayed)
  • Click Project name
  • click Task
  • click android
  • then click signingReport

your SHA-1 is generated, copy this SHA-1 and paste the Google console.

+1
source

I think you are still using your SHA1 for debug.keystore in your release build .. try to get your SHA1 on your keystore.

Windows terminal

 keytool -list -v -keystore "{PATH OF YOUR RELEASE KEYSTORE}" -alias {ALIAS} -storepass {StorePassword} -keypass {KeyPassword} 

OSX Terminal

 keytool -list -v -keystore {PATH OF YOUR RELEASE KEYSTORE} -alias {ALIAS -{STORE PASS} android -keypass {KEYPASS} 

Get your SHA1 and register it on the Google API console.

Hope this helps.,

+1
source

Source: https://habr.com/ru/post/1270652/


All Articles