I have developed a Android app, this app use Google Maps. On debug version I can see the map but in release mode I cannot see the map only a gray box.
To generate the release version I have use Android Studio (0.8.2) and I follow these steps:
This is the error on log: "Failed to load map. Error contacting Google servers. This is probably an authentication issue (but could be due to network errors)."
I have also try to generate a new API KEY, replace it on app and regenerate the Signed APK but I get the same result.
I do not find errors in my approach, I read a lot of articles on the internet about this.
Help me because I'm going crazy :)
It is necessary to obtain API key with release SHA-1. Do following steps:
keytool -list -v -alias ALIAS_NAME -keystore "PATH_TO_KEY_STORE" -storepass KEY_STORE_PASSWORD -keypass KEY_PASSWORD
All that info from (Build->Generate Signed APK)
Copy SHA1 from the output
Add new Google Map API key to your project. Use SHA-1 from step 2.
Switch build variant to release
Open values/google_maps_api.xml, replace API key with the one from step 2
That's it
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.