Reputation: 307
I have the problem that has been discussed here but without any solution helps me. The Google map is "gray" but just in release (when I build generate signed APK). I have tried to add API key to google_maps_api.xml under release folder but that didn't work. Also, I tried to add API right to the AndroidManifest.xml but with no result too. Thanks for the help.
Upvotes: 0
Views: 879
Reputation: 2267
When you generated your Google maps key, did you put SHA-1 of your debug, or of your release certificate? If you put debug SHA-1, add release also.
Also, proper way to do map implementation would be to have debug/res/values/google_maps_api.xml with key for debug and another release/res/values/google_maps_api.xml with key for production. There shouldn't be key in strings.xml. More about this you can read here.
Upvotes: 2
Reputation: 10330
Are you using ProGuard? If so then you'll need to add following to your ProGuard rules file:
-keep class com.google.android.gms.maps.** { *; }
-keep interface com.google.android.gms.maps.** { *; }
Upvotes: 2