Android Google Maps grey screen after publishing apk on play store

I made an Android app that uses Google Maps API to display a map.
When I run it with android studio it works fine. However after I publish it on the play store and download it from there all the maps show up as just grey screens.

I registered a key on google development console with both the debug SHA-1 key, which I got through this command:

keytool -list -v -keystore "%USERPROFILE%.androiddebug.keystore" -alias androiddebugkey -storepass android -keypass android

And the release SHA-1 key which I got with this command:

keytool -list -v -keystore [mykeystorepath] -alias [releaseAlias] -storepass [storepass] -keypass [keypass]

I've also unzipped my release APK and checked it with this command:

keytool -printcert -file CERT.RSA

And it shows the same SHA-1 key as the release key above.

Am I still getting the SHA-1 key for release incorrectly? Is there another way to get and verify it?

EDIT: I found the problem. It was like the top reply in Android SHA1 release keystore not working with Google Maps said. There were two google_maps_api.xml files, one in debug and one in release and android studio only showed the debug one. Manually editing the release xml to add the key fixe it.

链接地址: http://www.djcxy.com/p/81610.html

上一篇: 一键发布,网页部署,非DLL文件问题

下一篇: 发布apk上的Play商店后Android谷歌地图灰色屏幕