Google Maps on Android with MapView

Hi there!

I’ve having some trouble with the Google Map after submitting to the Google Play Store. My app uses Google Sign in which is working sometimes. However, it also uses the MapView and on Android when app is published and downloaded through Play Store the app simple won’t show.

The weird thing is that it’s there though. The Google logo at the bottom left is showing but the Map container is a grey box. I’ve logic for when map is pressed, such as read coordinates and this works when I press the map (!) It’s just that the actual map (or the layout of a map) is not showing.

I’ve read some about this on the forum but there is no real silver lining on how to resolve this. I’ve read that people have had problems with the hash being changed by Play Store due to App Signing.

So, I’ve done the following:

  • Followed the guide for Sign In: MapView - Expo Documentation
  • Followed the guide for MapView: MapView - Expo Documentation
  • Added the necessary keys on Google API and enabled the API’s used.
  • I’ve replaced the certificateHash (SHA-1) in app.json with the one from App Singning on Play Console. (Have also tried the one from the APK using the keytool -list -printcert -jarfile growler.apk | grep SHA1 | awk ‘{ print $2 }’ but with that the Sign In doesn’t work so I suppose the map wouldn’t work had I gotten to it.
  • I’ve rebuilt the application with exp build:android. Didn’t do it, so I released a new version on Play Store with the new APK created, and that didn’t do it either.

So I’m out of ideas here. As I said, Google Sign in works, map loads but doesn’t show any view of a map, just the things mentioned above. Pressing the map works which is really strange. My logic for map pressing is to collect coordinates from the press-event and reverse geocode that to an address and all of that works fine.

I’m using:

  • Expo SDK 25.0.0
  • exp CLI 53.1.0

Have tried it on:
Samsung Galaxy A3, SM-A320FL running Android 7.0
Samsung Galaxy S3 (!), GT-I9300 running Cyanogenmod on Android 6.0.1

The iOS works as intended.

Thanks for any help!
Cheers,

1 Like

Hey @layer10! Thanks for writing in, sorry about how long it has taken me to respond.

You may want to try updating your Expo SDK dependencies to the latest below and then report back with details on whether or not the version upgrade worked.

    "expo": "^27.0.1",
    "react": "16.3.1",
    "react-native": "https://github.com/expo/react-native/archive/sdk-27.0.0.tar.gz",

We should do a better job of making sure we understand some of the edge cases better and documenting.

Look forward to hearing back from you!

Hi @jimmylee !

Thank you for your response! No worries, I think you are fast enough :slight_smile:

Unfortunately this didn’t do it for me. I still have the same issues as above :confused:

Any ideas?

Hey @layer10 I’m not too familiar with the problem you’re having so I’ll have to apologize in advance for not having domain expertise.

An expert on the team directed me to this: Google Login problem with standalone app - #15 by pcooney10 - could you take a look and see if this is related to your problem?

If you’ve already checked that base, let me know and I’ll try to get more people involved.

Hi again @jimmylee !

Thank you for sticking with me :slight_smile:

I’ve checked that post and will run a debug on the device and see if anything of use pops up there. But what’s strange for me is that the sign in works fine but the map doesn’t. Although the map is “there” and can be “used” as I said earlier, pressing it works for example, but nothing shows such as streets, buildings and other mappy things. I suppose my google login would have been an issue as well dad there been a problem with the API key or hash.

If I install the standalone built APK on the device the map works, and running it in Expo works as well. So my guess is that something happens with something once the APK gets to the Play Store. And as I said earlier the certificate hash changes due to App Signing on Play Store but I’ve replaced the hash with that one but still no progress.

I’ll investigate some more but I maybe you could ask someone that’s familiar with the Google API’s regarding keys and certificate and maybe we could improve the guides have I missed something :slight_smile: Your help is much appreciated!

Thank you!

Hi @layer10. Can you try what people have suggested in this thread? Blank MapView on Android for Standalone After Publishing - #12 by goldeelocks

Hello @jesse !

Found it! A shoutout to @goldeelocks who pointed out that you need to add the new App Signing cert hash to allowed at your API key restrictions. Feel quite the fool for not seeing the obvious :confused:

So I’ve added both the standalone APK cert hash from when building with exp but also the one created by Play Store when going trough App Singing and now the map is working like a charm from anywhere I run it :smiley:

A big thanks to you guys @jesse and @jimmylee for your help!

Have a great day!

Thank you for using Expo! Sorry I didn’t fully understand the problem upfront :slight_smile: @jesse is my hero.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.