I have an Android app which makes use of Google Maps. All of a sudden, it stopped working in release mode. The Map view tells Google Play services are updating on the emulator and on real devices. Searching on the net everyone talks about the API key file, but this is not my problem!
I have tried every possible different combination of release settings, and I have found out that the problem occurs when I set debuggable = false
in the build configuration (with debuggable = true
it works). I can't understand why Maps aren't working because, of course, the APK is not debuggable. I have also tried multiple versions of Google Play services, even the latest (10.2.0
). No difference.
What can I do? Please help as I can't release any new release on Play Store until I fix this bug.
Google Play Services let your Android apps connect to the internet and communicate with Google. Updating Google Play Services can fix app issues, and help your Android device run faster. If updating Google Play Services doesn't help, you can also clear its cache and data.
This makes it faster for your users to receive updates and easier for you to integrate the newest that Google has to offer. That means you need Google Play services to make Google Maps work.
Google Play typically checks for app updates once a day, so it can take up to 24 hours before an app update is added to the update queue.
"If I set debuggable to false it stops working"
This suggests your API access is restricted to debug mode. Considering there are not separate API keys for debug and release it would appear your key has been tied to your debug certificate.
To quote "More about API key restrictions" on the documentation:
You can optionally add a restriction. For Android apps, you restrict the key to your app's SHA-1 fingerprint
If you have such a restriction in place, the differing fingerprint of the release certificate will break your API access.
Take a look at the "Getting the certificate information yourself" section of the documentation linked above to get the correct (release) certificate fingerprint
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With