google 地图上传到 google 播放后不显示
google maps doesnt show after upload to google play
我将我的应用程序上传到 google Play 商店,但地图不起作用,只是显示白屏。我知道我必须根据发布证书指纹获取密钥。我已尝试阅读所有相关内容,并已完成以下操作,但仍然无法正常工作:
我从 Android Studio 创建了一个新的密钥库(带有密码、别名和密码等)。
我 运行 cmd 并这样做了:
keytool -list -v -keystore key.jls -alias MyPlaces
然后输入我的密码,得到了我需要的所有信息。我根据获得的 sha1 指纹结果为 google 地图和地点 api 生成了密钥。我输入了我的包裹名称。我将别名代码放回我的应用程序中作为密钥。
但是还是不行。我知道其他人也遇到过这个问题,但对他们有帮助的并没有帮助我。
为什么?我希望我写的很清楚。谢谢
我不会在每次查看 Play 商店时都上传它。相反,我创建了签名的 apk,然后尝试从我的 phone 中 运行 它。这重要吗?
已编辑:
这是我在日志中收到的消息。
06-22 23:10:07.529 6500-6543/? E/b: 服务器验证失败。
06-22 23:10:07.530 6500-6543/? E/Google 地图 Android API:授权失败。请参阅 https://developers.google.com/maps/documentation/android-api/start 了解如何正确设置地图。
06-22 23:10:07.536 6500-6543/? E/Google 地图 Android API:在 Google 开发者控制台中(https://console.developers.google.com)
确保 "Google Maps Android API v2" 已启用。
确保以下 Android 项存在:
API 键:YOUR_KEY_HERE
Android Application (;): 38:......F0;com.....myplaces(为了安全我已经删除了这个)
考虑尝试这种方法:
- 首先,我看到您已经完成了开发者文档中描述的一些步骤。
- 但是,您应该为在开发人员控制台上创建的项目添加第二个调试密钥。
- 由于某些原因,如果两者都没有,有时发布时无法显示地图。
- 添加到您的
AndroidManifest
文件时,我也从使用 v2
切换到 geo
。
当然,您必须添加 INTERNET PERMISSION
,如果您使用 Gradle 依赖管理器,请从您的 sdk 添加 google-play-services
。
compile 'com.google.android.gms:play-services-maps:9.0.2'
希望对您有所帮助!让我知道进展如何!
首先检查您是否有调试和发布应用程序密钥。然后你必须 link 你的 api 到你的项目。 Api 和服务(google 玩控制台)。所以您必须配置 google 播放服务,因为 google 地图 api 使用它。
I know there are diferent keys for debug and released apps. i recomend
API v3 too.
Try this to register your api key.
https://console.developers.google.com/flows/enableapi?apiid=maps_android_backend&keyType=CLIENT_SIDE_ANDROID&r=24:85:5A:C0:F8:0D:36:4C:1A:B9:45:B6:21:92:B0:6E:7D:71:55:08%3Bcom.mapsapi.vatsan.googlemapsapidemo
It can take some minutes. Then you have to set your google_maps_key in
your android app Manifiest.
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSDSSDDDAAD...Your API KEY" />
If doesnt work and if you are using android studio, try creating a new
Map Activity(It's V3), complete res/values/google_maps_api.xml with
the key and the map gonna work. How to create google map
将 google 地图上传到 google Play 商店后,我可以在我的应用中使用它。您必须在 google 游戏控制台中配置 Google 游戏服务。
这个就是答案。
在我的日志中显示:
API Key: YOUR_KEY_HERE
Google 自动生成资源文件,googles_maps_api.xml 并在其中引用字符串:
<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">AIza....DOWdQ</string>
编译时,它不会识别这个字符串。我在strings.xml文件中做了一个字符串资源,然后就可以了。
我在 3 周后终于解决了这个问题:D
您上传 googleplay 您的 apk,现在您有 2 个不同的“SHA-1”,它们是
“安装证书(您的旧证书代码)”和“应用程序签名证书(新的,来自 googleplay)”
你需要做的很简单,你必须添加到 api 控制台你的新 SHA-1
我将我的应用程序上传到 google Play 商店,但地图不起作用,只是显示白屏。我知道我必须根据发布证书指纹获取密钥。我已尝试阅读所有相关内容,并已完成以下操作,但仍然无法正常工作:
我从 Android Studio 创建了一个新的密钥库(带有密码、别名和密码等)。
我 运行 cmd 并这样做了:
keytool -list -v -keystore key.jls -alias MyPlaces
然后输入我的密码,得到了我需要的所有信息。我根据获得的 sha1 指纹结果为 google 地图和地点 api 生成了密钥。我输入了我的包裹名称。我将别名代码放回我的应用程序中作为密钥。
但是还是不行。我知道其他人也遇到过这个问题,但对他们有帮助的并没有帮助我。
为什么?我希望我写的很清楚。谢谢
我不会在每次查看 Play 商店时都上传它。相反,我创建了签名的 apk,然后尝试从我的 phone 中 运行 它。这重要吗?
已编辑:
这是我在日志中收到的消息。
06-22 23:10:07.529 6500-6543/? E/b: 服务器验证失败。
06-22 23:10:07.530 6500-6543/? E/Google 地图 Android API:授权失败。请参阅 https://developers.google.com/maps/documentation/android-api/start 了解如何正确设置地图。
06-22 23:10:07.536 6500-6543/? E/Google 地图 Android API:在 Google 开发者控制台中(https://console.developers.google.com)
确保 "Google Maps Android API v2" 已启用。
确保以下 Android 项存在:
API 键:YOUR_KEY_HERE
Android Application (;): 38:......F0;com.....myplaces(为了安全我已经删除了这个)
考虑尝试这种方法:
- 首先,我看到您已经完成了开发者文档中描述的一些步骤。
- 但是,您应该为在开发人员控制台上创建的项目添加第二个调试密钥。
- 由于某些原因,如果两者都没有,有时发布时无法显示地图。
- 添加到您的
AndroidManifest
文件时,我也从使用v2
切换到geo
。
当然,您必须添加 INTERNET PERMISSION
,如果您使用 Gradle 依赖管理器,请从您的 sdk 添加 google-play-services
。
compile 'com.google.android.gms:play-services-maps:9.0.2'
希望对您有所帮助!让我知道进展如何!
首先检查您是否有调试和发布应用程序密钥。然后你必须 link 你的 api 到你的项目。 Api 和服务(google 玩控制台)。所以您必须配置 google 播放服务,因为 google 地图 api 使用它。
I know there are diferent keys for debug and released apps. i recomend API v3 too.
Try this to register your api key.
https://console.developers.google.com/flows/enableapi?apiid=maps_android_backend&keyType=CLIENT_SIDE_ANDROID&r=24:85:5A:C0:F8:0D:36:4C:1A:B9:45:B6:21:92:B0:6E:7D:71:55:08%3Bcom.mapsapi.vatsan.googlemapsapidemo It can take some minutes. Then you have to set your google_maps_key in your android app Manifiest.
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="AIzaSDSSDDDAAD...Your API KEY" />
If doesnt work and if you are using android studio, try creating a new Map Activity(It's V3), complete res/values/google_maps_api.xml with the key and the map gonna work. How to create google map
将 google 地图上传到 google Play 商店后,我可以在我的应用中使用它。您必须在 google 游戏控制台中配置 Google 游戏服务。
这个就是答案。
在我的日志中显示:
API Key: YOUR_KEY_HERE
Google 自动生成资源文件,googles_maps_api.xml 并在其中引用字符串:
<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">AIza....DOWdQ</string>
编译时,它不会识别这个字符串。我在strings.xml文件中做了一个字符串资源,然后就可以了。
我在 3 周后终于解决了这个问题:D
您上传 googleplay 您的 apk,现在您有 2 个不同的“SHA-1”,它们是 “安装证书(您的旧证书代码)”和“应用程序签名证书(新的,来自 googleplay)”
你需要做的很简单,你必须添加到 api 控制台你的新 SHA-1