Android的SHA1发布密钥库工作不与谷歌地图 [英] Android SHA1 release keystore not working with Google Maps
问题描述
我使用的是谷歌地图Android的API和我遇到的一些问题。
I am using the Google Maps Android API and I'm running into some issues.
我签我的APK与Android工作室(在.android / keystore.jks创建一个)。当然我也会选择释放,如它的类型。我用命令
I am signing my apk with android studio (created one at .android/keystore.jks). Also I'm selecting "release" as type in it. I have used the command
keytool -list -v -keystore C:\Users\Toshiba\.android\keystore.jks
要获得SHA1指纹出来的密钥库。
to get the SHA1 fingerprint out of the keystore.
的SHA1是正确的,但地图上没有一个签名的APK所示。它显示在一个调试APK
The SHA1 is correct, but the Map is not shown on a signed APK. It is shown in a debug APK.
使用密钥工具一起发布密钥库(keystore.jks)中,将获得我:
Using keytool with the release keystore (keystore.jks) will get me this:
SHA1: 33:46:07:82:5B:D4:45:D2:60:CE:5A:29:97:9F:6C:44:XX:XX:XX:XX
调试一期工程正常(我加2到谷歌的API控制台)
The debug one works fine (I have added 2 to the API console in Google)
33:46:07:82:5B:D4:45:D2:60:CE:5A:29:97:9F:6C:44:XX:XX:XX:XX;yac.breakingpoint
7C:28:61:5B:C3:4A:5C:50:44:AA:FD:58:69:E9:70:91:XX:XX:XX:XX;yac.breakingpoint
XX都黑了。
XX is blacked out.
密钥工具说,这是用SHA256withRSA作为签名算法为,调试和释放密钥库。
The keytool says it is using SHA256withRSA as signature algorithm for both, the debug and the release keystore.
我是什么做错了吗?
更新 所以我尝试了新的API密钥,清洁工程和重建它,新的密钥库 - 仍然没有工作的释放......调试是好的
UPDATE So I've tried a new API key, clean project and rebuild it, new keystore - still not working on release... debug is fine!
更新2 仍然没有找到一个有效的解决方案......救救我!
UPDATE 2 Still not found a working solution... Help me!
更新3 还好吧,得到它的工作使用签名的APK与构建类型调试。提取CERT.RSA并拼命地跑密钥工具-printcert -file ./CERT.SA
。得到了相同的结果作为发布版本的类型。在释放它不工作!
UPDATE 3 Allright, got it working using a signed APK with build type debug. Extracted the CERT.RSA and runned keytool -printcert -file ./CERT.SA
. Got the same result as for the release build type. In release it is not working!
更新4 这里还有一个试试我做:
UPDATE 4 Here's another try I made:
- 创建一个新的Git仓库,COMMITED吧。
- 的
/编译
文件夹不beeing COMMITED,因为他们是在的.gitignore
文件。 - 创造了API控制台一个新的API密钥,只加在发布 SHA1钥匙。
- 新增的API密钥的应用程序,并提出了全面清理与重建。
- 在生成新签署的APK文件
- Created a new GIT Repository, commited to it.
- The
/build
folders are not beeing commited since they are in the.gitignore
files. - Created a new API key in the API console and added only the release SHA1 key to it.
- Added that API key to the app and made a full clean with rebuild.
- Generated a new signed APK file
它没有工作。
更新5 我的一个朋友试图重现此问题。与Android的工作室工作时,他有完全一样的问题。可能是一个机器人工作室的错误?
UPDATE 5 A friend of mine tried to reproduce this issue. He has the exact same issue when working with android studio. Probably a android studio bug?
推荐答案
也许你有两个的 google_maps_api.xml 的文件,一个在应用程序/ src目录/ 调试 / RES /值的文件夹和其他在应用程序/ src目录/ 发布 / RES /值的文件夹中,但只有在调试一个含有您的API密钥。
Maybe you have two google_maps_api.xml files, one in the app/src/debug/res/values folder and the other in the app/src/release/res/values folder, but only the debug one contains your API key.
这篇关于Android的SHA1发布密钥库工作不与谷歌地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!