MapView not working in app released to play store

#1

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.

#2

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

adb install

#3

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 ?

#4

@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.)

#5

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

#6

As i mentioned, app works perfectly fine with adb install

#7

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

#8

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

#9

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.

5 Likes
#10

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: https://docs.expo.io/versions/latest/sdk/map-view).

Maybe the @Expo guys must be update https://docs.expo.io/versions/latest/sdk/map-view#deploying-to-a-standalone-app-on-android paper to handle this scenario.

Thanks !!!