问题描述
1)创建新项目。 2)选定的Google地图创建。
$ b 3)调试google_maps_api .xml步骤紧随其后。
-
-
创建了Google开发者控制台API密钥。
平移= 假 >
AIzaSyDRuMUTElAoXoK2y2rXSqtpvdQSZ12z_dk
将/串GT;
4)随后发布google_maps_api.xml步骤。
-
developers.google.com/maps/documentation/android/signup步骤。
> -
keytool -list -keystore your_keystore_name
-
-
keytool -list -v -keystore your_keystore_name -alias your_alias_name :62:90::A1:66:6E:__:5D:75新增了 创建了Google开发者控制台API密钥。
< string name =google_maps_keytemplateMergeStrategy =preserve
translatable =false>
AIzaSyB3d_usre_Joj_TrgP3aKtdkrSt_tTeqGI
将/串GT;
加入不同的释放键
$ b AndroidManifest.xml
-
< meta-data
android:name =com.google.android.geo.API_KEY
android:value =@ string / google_maps_key/> $ c $
<使用权限android:name =android.permission.INTERNET/>
<使用权限android:name =com.google.android.providers.gsf.permission.READ_GSERVICES/>
< uses-permission android:name =android.permission.ACCESS_COARSE_LOCATION/>
6)生成已签名APK创建,生成类型发布版本创建。
$ b $ 7 7)在Play商店发布Beta版本。
8)谷歌地图屏幕空白。
$ b $ 9)但是本地运行的应用谷歌地图工作正常。
10)在google开发者控制台上正确添加了所有包名。
解决方案由于SHA 1 Fingerprint不匹配。仔细检查您是否使用了相同的密钥库来获取SHA1和apk版本。
或
让我们来检查您的API密钥是否有效。
对于添加以下MAP_API为您释放键
AIzaSyDztCvpv3PVBxzWwY7mWqCMnGfDeOiGxwY
在您的AndroidManifest.xml中添加以下权限(可选/不必)
< permission
android:name =your_pakage_name.permission.MAPS_RECEIVE
android:protectionLevel =signature/>
构建您的发行版apk。并测试它。
如果地图显示,我们可以修复您的API密钥是问题。
所以,让您的谷歌开发者控制台再次获得Sha1并更新。
1) Created new project.
2) Selected google map created.
3) Debug google_maps_api.xml steps followed.
created google developer console API key.
<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false"> AIzaSyDRuMUTElAoXoK2y2rXSqtpvdQSZ12z_dk</string>
4) Release google_maps_api.xml steps followed.
developers.google.com/maps/documentation/android/signup steps.
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
created google developer console API key.
<string name="google_maps_key" templateMergeStrategy="preserve"translatable="false"> AIzaSyB3d_usre_Joj_TrgP3aKtdkrSt_tTeqGI</string>
added different release key.
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) Generate signed APK created, Build Type release version created.
7) Beta version published on play store.
8) Google map screen blank.
9) But local running app google map working fine.
10) All package name correctly added on google developer console.
解决方案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.
orLet'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.
这篇关于Android谷歌地图空白的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!