expo: MapView not working on Android (provider: google)

Hi guys! šŸ‘‹ First of all, thank you for your work! This project is awesome!

Problem: (that you can easy reproduce) image Platforms: Android, Android emulator. My OS: MacOs Mojave 10.14 expo-cli: 2.2.5

Just a month ago the same code was working, but today I spent the whole day to solve this problem that you can see on the screen above. I’ve created a new project with the newest expo (v31), react-native and react-native-maps (v21), but… no results.

On the iOS emulator, everything is good. Maybe this problem is related to package react-native-maps but in the installation guide of this lib contains information about including some API keys and builders inside .xml. files of the Android project, like this: image image

In this case, an expo.io project doesn’t contain the folder android, that’s why I decided to create an issue in this repository. Also, the problem also may be in the google. I don’t know.

Best regards, Nikita

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 8
  • Comments: 41 (11 by maintainers)

Most upvoted comments

Hi all – apologies for the inconvenience caused by this issue! šŸ˜ž We just released version 2.9.1 of the Expo client to the Play Store which should fix this. Please upgrade and let us know if it’s still broken. (If you don’t see the update yet, give it a few hours – sometimes updates take a little while to propagate.)

@dsokal First of all thank you for trying to resolve the issue. Issue occurs on Android. Issue occurs locally (local project created with Expo CLI) or in Snack. Issue has been reported for SDK31 but people reported it occuring on lower versions too. Even the Snack you posted proves there is an issue. šŸ˜„

It occurs in ā€œdevelopmentā€ and ā€œproductionā€ modes, it affects published apps too. Standalone apps are unaffected, because they use the provided API key we set in app.json and there is no problem.

image

I think there is nothing WE can fix at the moment. 😃

It would be great if for development we can use our own API key we set in app.json as well, if an API key cannot be found then to fallback to Expo’s default API key.

Build your app and you’ll see that on standalone it works fine.

That was it for me. Once I added the Google Play console SHA-1 certificate fingerprint to the API key and the OAuth 2.0 client ID under the Google Cloud Console API for the project, things started working. At first, my sign-in did not work, and second my maps would not show.

When you are deploying to Google Play (and you are a first timer like me), they ask you if they can sign the app for you. I chose yes, but I did not know that meant I had to apply those keys to the Google Cloud Console for them to be accepted. It makes perfect sense now, but it was very confusing when it happened.

For my project, the map works fine in the expo app, but once published to the store I get a blank screen. Everything works great on iOS tho.

@dsokal Yes, I’m sorry, but the problem still remains. No map in expo dev mode…

@dsokal a fix to where? we’re experiencing the issue only while using expo dev mode, not on standalone apps

I am experiencing the same problem, any solution?

Same problem here with sdk 31. Everything worked fine with sdk 24. Since I have updated my dependencies, iOS still works but blank map for android. Did you found some fix?

Same here, in development mode. Map shows the Google logo, but there is no content. Maybe something is wrong with Expo API keys.

Expo CLI 2.2.5 environment info: System: OS: Windows 10 Binaries: Yarn: 1.10.1 - C:\Program Files (x86)\Yarn\bin\yarn.CMD npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD

Diagnostics report: https://exp-xde-diagnostics.s3.amazonaws.com/danikane-a9919a86-ba78-4d98-8f27-c582be8d4d84.tar.gz