Android google map blank

前端 未结 3 1739
栀梦
栀梦 2021-01-12 22:56

1) Created new project.

2) Selected google map created.

3) Debug google_maps_api.xml steps followed.

  • https://console.developers.google.com/f

相关标签:
3条回答
  • 2021-01-12 23:24

    I am assuming that this may due to mismatch SHA 1 Fingerprint. Double check that you are using the same keystore for getting SHA1 and apk release.

    or Let's check your API key is valid or not. For that add following MAP_API as your release key

    AIzaSyDztCvpv3PVBxzWwY7mWqCMnGfDeOiGxwY
    

    Add following permission in your AndroidManifest.xml (Optional/not necessary)

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

    Build your release apk. And test it.

    If the map is showing then we can fix that your API key is the problem.

    So get Sha1 one more time and update in your google developer console.

    0 讨论(0)
  • 2021-01-12 23:25

    You are generating SHA-1 in cmd. sometimes cmd returns local SHA-1 not Administrator. So try to create SHA-1 from Android studio. follow steps to generate SHA-1:

    1. Click on Gradle (right panel of the studio where Preview option shows)
    2. Click on Project name
    3. click on Task
    4. click on android
    5. then click signingReport

    your SHA-1 is generated copy this SHA-1 and paste in google console.

    0 讨论(0)
  • 2021-01-12 23:35

    I think your still using your SHA1 for debug.keystore on your release build.. try to get your SHA1 on your release 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 your Google API Console..

    Hope it helps. .

    0 讨论(0)
提交回复
热议问题