react-native-maps: Android map not working correctly, markers loading and not loading
Summary
map load but dont display markers.
Reproducible sample code
https://github.com/edgarscr/minimal-error-expo
Steps to reproduce
npm -v 10.8.2
node -v v20.18.0
npm install
npx expo start --clear --go
Expected result
Always need show markers
Actual result
open app markers appear on map on first load but if u close and open again map load but dont display markers.
React Native Maps Version
1.18.0
What platforms are you seeing the problem on?
Android
React Native Version
0.76.3
What version of Expo are you using?
SDK 52
Device(s)
Any android
Additional information
No response
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 21
- Comments: 16
Commits related to this issue
- app.json: disable new architecture The react-native-maps viewer is broken on Android with the new architecture, so we need to revert this for now. xref https://github.com/react-native-maps/react-nat... — committed to stevekuznetsov/avy by stevekuznetsov 2 years ago
- app.json: disable new architecture (#837) The react-native-maps viewer is broken on Android with the new architecture, so we need to revert this for now. xref https://github.com/react-native-maps/re... — committed to NWACus/avy by stevekuznetsov 2 years ago
This is good, but i was still having the issue of it not working sometimes on android, so update on this is
I’m facing this problem and I came up with a somewhat inelegant workaround. I’ve noticed that the MapView component doesn’t actually invoke the onMapReady callback when the markers are not loaded. So, using a state variable and
useEffect, I check if the markers are not loaded and force the re-render of the map if that’s the case. You can take a look at this code for some more insight, hopefully it’s not too uglyFacing same issue with new architecture, any fixes?
Experiencing the same. When that happens, neither
onMapReady, noronMapLoadedcallback props fire. Scoped to RN 0.76, Expo v52, and the new Architecturefacing same issue
I am experiencing the same bug. I fetch the data for the region and the markers using a useEffekt hook, but sometimes the region and markers are just ignored and I see a world map without any data. The data is defintiely there, but not displayed. Even if I conditionally only render the map once the data is loaded it might not show the region and markers.
I’m facing the same issue. My solution was to set newArchEnabled to false in the gradle.properties file with
"react-native": "0.76.5"same issue here. Any fix??
Similar issue here, do we know if this is getting addressed?
If you are using Expo and run
npx expo install --check, you will see in the logs that this package is not supported in React Native’s New Architecture. I believe this will also affect bare React Native apps using the New Architecture.Temp Solution
You do not have to downgrade Expo or React Native to fix this. Simply set
newArchEnabledtofalsein yourapp.jsonand rebuild your app:app.json:expo prebuildagain, orThis should resolve the marker issues you are experiencing.
Noticing the same issue with new architecture, on Android it seems like the child prop is not used to create actual child elements.
I found out about this error on the newArch. While i am able to zoom into the map using map ref and MapView onLayout prop, i can’t say thesame for MapMarker. As of now, it sometimes gets hidden when the page rerenders.
When i changed “newArchEnabled”: false, in my expo app.json, those issues did not occur.
I need the newArch for performance benefits of Flatlist and others, please fix.