Google Maps v2 Authorization failure. Different SHA1

前端 未结 3 1445
不思量自难忘°
不思量自难忘° 2020-12-18 10:47

I have read all the similar questions and did everything that was described in them, but did not help.

Google Maps API v2 is Enabled and API key is correct

I

相关标签:
3条回答
  • 2020-12-18 11:42

    It sounds like you're using the SHA1 fingerprint from the keystore that you will be using to generate a signed apk.

    For debugging/running from Android Studio, you need to use the SHA1 fingerprint that Android Studio uses to sign the apk.

    Note that you can get this SHA1 fingerprint by using command line:

    For Mac or Linux:

    keytool -list -v -keystore ~/.android/debug.keystore
    

    For Windows:

    keytool -list -v -keystore C:\User\YourUser\.android\debug.keystore
    

    with password "android".

    However, since you already have the correct value in your logs, just copy this from your logs (I modified it here, don't copy from here):

    8C:2B:4C:F7:CF:FB:EC:D5:DC:D7:D0:5D:6E:30:49:xx:xx:xx:xx:xx;com.dandewine.user.thinkmobiletest
    

    And paste that into your API Key in the developer console.

    You can add multiple fingerprint/package values to each API key, one per line (you can also see that in the instructions when you are editing an API key).

    You can also configure a different API key for debug and release, if you do that take a look at this answer.

    0 讨论(0)
  • 2020-12-18 11:45

    add the following in manifest:

    <permission
        android:name="com.dandewine.user.thinkmobiletest.permission.MAPS_RECEIVE"
        android:protectionLevel="signature" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="com.tp.lib.tp.permission.MAPS_RECEIVE" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    

    also:

    <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true" />
    
    0 讨论(0)
  • 2020-12-18 11:46

    Check if you have included your signature key in debug and release mode, read this: http://developer.android.com/tools/publishing/app-signing.html#cert

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