简体   繁体   English

Android Google地图授权失败

[英]Android Google Maps authorization failure

I have reviewed all similar questions regarding Google Maps authorization failure but it did not help. 我已经审核了有关Google地图授权失败的所有类似问题,但它没有帮助。

Google Maps Api v2 is enabled and correct. Google Maps Api v2已启用并且正确无误。 Android Keys for Debug and Release builds are correct and their corresponding validation Package Names and Fingerprints are correct. 用于调试和发布版本的Android密钥是正确的,其相应的验证包名称和指纹是正确的。

Now, the first strange thing is that Google Maps had been working perfectly for 1 and a half years and we did not register any errors until 23 May 2016. We did not change anything in Google Dev Console or in Application that would be a threat to Google Maps functionality. 现在,第一件奇怪的事情是Google Maps已经完美运行了一年半,我们在2016年5月23日之前没有注册任何错误。我们没有更改Google Dev Console或Application中的任何内容Google Maps功能。

The second strange thing is that this error only occurs on Release builds and Debug builds are working fine. 第二个奇怪的是,这个错误只发生在Release版本上,而Debug版本工作正常。 With this in mind I tried to generate another Android Key for maps (without package/fingerprint validation) but it did not help. 考虑到这一点,我试图为地图生成另一个Android Key(没有包/指纹验证),但它没有帮助。

Android Manifest contains these permissions: Android Manifest包含以下权限:

com.google.android.providers.gsf.permission.READ_GSERVICES
ACCESS_COARSE_LOCATION
ACCESS_FINE_LOCATION
INTERNET
ACCESS_NETWORK_STATE
WRITE_EXTERNAL_STORAGE

We also use: 我们还使用:

<uses-feature
    android:glEsVersion="0x00020000"
    android:required="false" />

Play Services Maps API: Play Services Maps API:

compile 'com.google.android.gms:play-services-maps:6.5.87'

Yes, this API is quite old but updating it to 8.4.0 did not help either. 是的,这个API很老了,但将其更新到8.4.0也没有用。

Google Maps authorization failure we're getting: 我们收到的Google地图授权失败:

E/Google Maps Android API﹕ Authorization failure.  Please see            https://developers.google.com/maps/documentation/android/start for how to correctly set up the map.
07-27 14:52:37.551  25002-25035/com.package.name E/Google Maps Android API﹕ In the Google Developer Console (https://console.developers.google.com)
Ensure that the "Google Maps Android API v2" is enabled.
Ensure that the following Android Key exists:
API Key: ******************************
Android Application (<cert_fingerprint>;<package_name>): finger:print;com.package.name

If someone had any ideas on where or why such a problem could suddenly happen I would be more than happy with any help. 如果有人对这个问题突然发生的地点或原因有任何想法,我会对任何帮助感到高兴。

Thank you. 谢谢。

 Try to use updated google map api 

 compile 'com.google.android.gms:play-services-maps:8.4.0'
 compile 'com.google.android.gms:play-services-location:8.4.0'

  and check whether you had used these permission in app
   <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
   <uses-permission android:name="com.example.permission.MAPS_RECEIVE" />
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />

 and used these meta tag within application
 <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version"/>
     <meta-data
        android:name="com.google.android.maps.v2.API_KEY"
        android:value="@string/application_id" />  

      // as unauthorized occurs just because of invalid app id which created on google developer console 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM