MapView not working in app released to play store

It works while development and works with the apk built and installed locally but doesn’t work when app is installed from play store.
Just blank canvas and google logo appears.
I have followed the instructions here https://docs.expo.io/versions/latest/sdk/map-view.html

created api key and credentials multiple times. No luck.

I also see api requests in google cloud console when i installed apk locallly with

adb install

Hi @atinder90,

Just to be sure when you build your APK, you compile with your google apikey set in app.json:

 ....
  "android": {
    "package": "com.bubul.speudyland",
    "config": {
      "googleMaps": {
        "apiKey": "<YourApiKeyHere>"
      }
    }

Did you check Expo doc ?

@speudyland yes I posted the link to the same doc as well.

Also I am able to see api requests in google cloud console when apk is installed with adb install (which means setup seems to be correct.)

Oh sorry didn’t see the link :wink: So yes it’s weird…any exception in pre-launch report ?

I will check the log with (adb logcat E:*) with your device is connected to see what is not correct. Last time for us it was some missing permissions. And also we need to have “android.permission.” as suffix before each permissions.

Post expo permissions issue

As i mentioned, app works perfectly fine with adb install

There are several steps you need to carefully follow for maps in detached apps. I would recommend going through each one here: https://docs.expo.io/versions/latest/sdk/map-view.html#deploying-to-a-standalone-app-on-android

thanks for reverting @ide
I have followed all those step, that’s why my apk file works when I installed with adb install /path/to/app.apk


when I submit the same apk to the play store, it doesn’t work

I have solved the problem. If someone else is also stuck with this same issue.

Goto Play store app dashboard → Release Management → Artifacts
Click Download icon and select Download Derived apk

Generate SHA-1 certificate fingerprint for Derived apk using keytool and add it under Restrict usage to your Android apps.

4 Likes

Thanks @atinder90, im dealing with the same issue for hours …

Same here: https://github.com/expo/expo/issues/240

Anyones knows why Google creates a new derived APK file? it broke the generated “SHA-1 certificate fingerprint” from build file (step 10 from here: MapView - Expo Documentation).

Maybe the @Expo guys must be update MapView - Expo Documentation paper to handle this scenario.

Thanks !!!

Much love atinder90. This has been incredibly painful to figure out.

Can anyone on this thread help me? been strugling with these for days.
How to generate the SHA-1 ceritifcate?
The docs are still outdated?

This happens when you have opted for Google to handle signing. This is mentioned in the documentation about Building Standalone Apps. Follow the guide under AppSigning in order to get the correct SHA-1 key for the deployed Android App.

NOTE: You can safely do this AFTER you’ve uploaded to the app store. You will add the value to the Cloud Platform Console, and it will usually make your maps work within minutes.