Android 谷歌地图在构建到 apk 文件中时不起作用 [英] Android google maps not working when it builds into an apk file

查看:26
本文介绍了Android 谷歌地图在构建到 apk 文件中时不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在开发一个带有谷歌地图片段的安卓应用程序,当我测试它并使用通过笔记本电脑上的 USB 连接的实际设备在 android studio 上运行它时,谷歌地图片段工作正常,但是当我构建一个 apk 文件时并将其安装在 android 设备上,谷歌地图无法正常工作,我看不到地图,但应用程序没有崩溃

I am currently developing an android application with google maps as a fragment when i test it and run it on the android studio using an actual device connected via usb on my laptop the google maps fragments works fine but when i build an apk file and install it on the android device the google maps is not working i cannot see the maps but the app is not crashing

我的项目有什么问题?

推荐答案

要创建 Released Key,首先需要生成 keystore.之后,您需要使用该 keystore 生成新的 SHA1 密钥.

To create Released Key, you need to generate keystore first. After that you need to generate new SHA1 Key using that keystore.

C:\Program Files\Java\jdk1.7.0_75\bin>keytool -list -v -keystore C:\Users\shvet\Downloads\keytool -alias android -storepasskeystorename -keypass androidpass

其中 C:\Users\shvet\Downloads\keytool 是我的密钥库路径.

where C:\Users\shvet\ Downloads\keytool is my keystore path.

-alias android 是我在生成 apk 时制作密钥库时的别名.

-alias android is alias name when i made keystore while generating apk.

-storepass keystorename 是密钥库密码的名称.

-storepass keystorename is name of keystore password.

-keypass androidpass 是 SHA1 的密码.

-keypass androidpass is password for SHA1.

使用此 SHA1 密钥生成新的 Google 地图密钥.

Use this SHA1 key to generate new Google map Key.

这篇关于Android 谷歌地图在构建到 apk 文件中时不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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