Google Maps无法在衍生的APK中使用(已发布的应用) [英] Google Maps not working in derived apk (published app)

查看:75
本文介绍了Google Maps无法在衍生的APK中使用(已发布的应用)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,我想先尝试一下多种解决方案,例如:

Ok, I want to preface that I have tried multiple solutions such as:

Android Studio-Google地图在实际情况下仍为空白Android设备

发行版中的Android Google Maps API不起作用

我试图获取SHA1指纹,并将这些限制"添加到Google Developer Console API凭据中.

I've tried to obtain the SHA1 fingerprint, and added those "Restrictions" to the Google Developer Console API Credentials.

还尝试将API硬编码到清单中(找不到推荐这样做的链接).

Also tried hardcoding the API into the manifest (can't find the link that recommended this).

在这一点上,我将其范围缩小到以下可能的问题:

At this point, I've narrowed it down to these possible issues:

1)我正在使用的密钥库在检查时具有以下行

1) The keystore I am using has the following line when checking it

签名算法名称:SHA256withRSA

Signature algorithm name: SHA256withRSA

我注意到许多解决方案都在谈论使用SHA1withRSA. 但是由于这将需要创建一个新的密钥库,而我将不得不为其创建一个全新的应用程序,因此我避免了这一结论.

I noticed that many of the solutions talked about having SHA1withRSA. But since this would require creating a new keystore, to which I would have to create a whole new app, I'm avoiding this conclusion.

2)我还注意到上传到Play控制台的原始APK确实有效. 但是派生APK(我认为是上载到Play商店的APK)无法正常工作.

2) I've also noticed that the Original APK uploaded to Play console actually works. But the Derived APK (which I assume is the one uploaded to the Play Store) does not work.

3)Google Developer Console中的API库没有专门

3) The API library in Google Developer Console does not have specifically

"Google Maps Android API v2"

"Google Maps Android API v2"

它仅显示"Google Maps Android API".我认为这不应该成为问题.

It only shows "Google Maps Android API". I assume this shouldn't be the issue.

只需澄清一下,问题是我的应用程序中的地图"显示为空白.

Just to clarify, the issue is that the Map in my app comes up blank.

推荐答案

好,我刚刚解决了它(在13分钟前发布此帖子之后).

Ok, I just solved it (after making this post 13 minutes ago).

因此,在实施此解决方案之后

So after implementing this solution

Android Studio-Google地图在实际情况下仍为空白Android设备

我注意到从手机运行apk时,Android Monitor中出现此错误:

I noticed that this error in my Android Monitor when running the apk from my phone:

Android Application (<cert_fingerprint>;<package_name>): <what I assume is a SHA1 fingerprint>;<my_package_name>

因此,我只复制了SHA1指纹,将其添加到API凭证限制中并保存了它.几分钟后,再次运行该应用程序,它开始运行.

So I just copied the SHA1 fingerprint, added it to the API credential restrictions and saved it. And after a few minutes, ran the app again, and it worked.

无需重新上传/更新APK.

No need to reupload/update apk.

希望这对其他人有帮助.

Hope this helped anyone else.

这篇关于Google Maps无法在衍生的APK中使用(已发布的应用)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆