Android Studio - Google Map Still Blank On Real Android Device On Release Apk


Answer :

Make sure you enter your release API key in the google_maps_api.xml under the release folder.

First, switch to Project view by using the dropdown in the upper left of the Project Explorer. Then, expand app/src/, and you will see subfolders debug and release. Under there, you should see two separate google_maps_api.xml files under debug/res/values and release/res/values.

Make sure that the release API key is in the google_maps_api.xml file under the release/res/values folder, since this is the one that will be used for the signed release apk.

enter image description here


i was tired of trying over and over again, it turns out that PlayStore has something called App signing certificate, and the map works after i copy that sha1 and paste it in the google console for the android map.


Go to https://play.google.com/apps/publish/ and then to App signing:

enter image description here

Maybe you will see this:

enter image description here

If that is the case, maybe you are a developer and not the account owner. You will have to contact the account owner and ask him/her to complete that process. Follow this article about how to do that:

https://learnfreecoding.com/how-to-sign-your-android-app-with-signed-key-private_key-pepk/

The account owner will get to this screen:

enter image description here

Ask them to choose Upload a key exported from Android Studio. They will have to upload a private_key.pepk file. This is how you get that file from Android Studio:

  • Go to Build > Generate Signed Bundle / APK....

enter image description here

Select Android App Bundle and click Next:

enter image description here

Provide the corresponding credentials and make sure to put the check on for Export encrypted key for enrolling published apps in Google Play App Signing.

enter image description here

Specify the destination folder and make sure you select release before you click Finish:

enter image description here

That will generate the private_key.pepk file that you need to provide to Upload a key exported from Android Studio.

After doing the above, when you to to the App signing section of your app, you will see something like this:

enter image description here

Then you will see the Google Maps working correctly on real Android Studio physical devices and not only on the Android Studio Emulator. This was the solution for me.


Comments

Popular posts from this blog

Are Regular VACUUM ANALYZE Still Recommended Under 9.1?

Can Feynman Diagrams Be Used To Represent Any Perturbation Theory?