我在API控制台生成了两个API密钥,一个用于调试SHA1(无限制),另一个用于生产使用release keystore SHA1(有Android应用限制)。
我将API分别放在debug..\google_maps_api.xml和release..\google_maps_api.xml中,并在结束应用程序标记的上方添加了Manifest中的元数据。我生成了一个签名的APK,地图加载正常。我的清单如下所示
<application
<activity
android:name=".MainActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden|adjustResize" />
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<activity
android:name=".MapsActivity"
android:label="@string/title_activity_maps"
android:screenOrientation="portrait" />
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_maps_key" />
</application>我使用签名服务V1(Jar签名)和V2(完整的APK签名)生成了签名的APK。在Playstore中发布后,地图未加载。有人能在这方面给我指点一下吗?
发布于 2017-06-13 23:53:03
发布于 2021-05-26 16:59:46
这个问题的一个解决方案是,如果你正在使用谷歌的应用程序签名,他们会为你注销你的应用程序,并且有一个新的-1密钥,你需要添加到密钥限制中。这就是为什么它是在你签名和安装的时候工作的,而不是在上传到Play Console之后。
通过选择app -> Setup -> App Integrity,可以在https://play.google.com/console上找到该软件。
在你将这个SHA-1指纹添加到你的密钥后,应用程序将开始工作,不需要新的构建。
https://stackoverflow.com/questions/44511578
复制相似问题