react-native-maps: RN 0.76.1 – Markers Not Displaying / Fabric support / new arch
Summary
I encountered an issue with the react-native-maps library when using the “Default Markers” example. When I tap on the map to add a marker, nothing appears on the first tap. However, when I tap to add a second marker, the first one then appears, and this behavior repeats with subsequent taps (i.e., the previous marker only appears after the next tap). It seems like the initial action isn’t processed immediately, and each marker only renders after the following interaction.
Reproducible sample code
class DefaultMarkers extends React.Component<any, any> {
constructor(props: any) {
super(props);
this.state = {
region: {
latitude: LATITUDE,
longitude: LONGITUDE,
latitudeDelta: LATITUDE_DELTA,
longitudeDelta: LONGITUDE_DELTA,
},
markers: [],
};
}
onMapPress(e: any) {
this.setState({
markers: [
...this.state.markers,
{
coordinate: e.nativeEvent.coordinate,
key: id++,
color: randomColor(),
},
],
});
}
render() {
return (
<View style={styles.container}>
<MapView
provider={this.props.provider}
style={styles.map}
initialRegion={this.state.region}
onPress={e => this.onMapPress(e)}>
{this.state.markers.map((marker: any) => (
<Marker
key={marker.key}
coordinate={marker.coordinate}
pinColor={marker.color}
/>
))}
</MapView>
<View style={styles.buttonContainer}>
<TouchableOpacity
onPress={() => this.setState({markers: []})}
style={styles.bubble}>
<Text>Tap map to create a marker of random color</Text>
</TouchableOpacity>
</View>
</View>
);
}
}
Steps to reproduce
Steps to Reproduce:
- Set up a new test project and update React Native to version 0.76.
- Use the react-native-maps library and try the “Default Markers” example.
- Tap on the map to add the first marker.
- Observe that the first marker doesn’t appear immediately.
- Tap again to add a second marker, and see that the first marker then appears.
Expected result
Each marker should appear on the map immediately upon tapping to add it.
Actual result
Markers not displayed on first action
React Native Maps Version
v1.18.2
What platforms are you seeing the problem on?
iOS (Google Maps)
React Native Version
0.76.1
What version of Expo are you using?
Not using Expo
Device(s)
iPhone 16 Plus
Additional information
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 45
- Comments: 194 (19 by maintainers)
@metkm yes it is much faster / native like behaviour, this is what I’m observing.
quick update for this weekend, finally the migration is done for the MapView itself https://github.com/salah-ghanim/react-native-maps/tree/feat/mapview-newarch the new version includes all functions, events and callbacks of the MapView working.
I will test one more time tomorrow and publish a beta version for testing. I expect that I will still need to work on the Markers to be migrated as well, but we shall see. aside from that I see a bug / crash around animation.
once the beta is published some help will be needed to test it anyone available to help testing please let me know.
finally new alpha release v1.21.0-alpha.53 with very basic android support it includes:
I will focus first on finishing the Map and Marker implementation, then continue on other map features (Polygon …)
Quick update. finally there is a clear path to migrate all functionality to the new arch / Fabric. The last piece of the puzzle was getting data from native, for example (getCamera, takeSnapshot …)
this is now working https://github.com/salah-ghanim/react-native-maps/tree/feat/mapview-newarch
next is to arrive at feature complete for iOS to ship a beta version of the library. then we can focus on android, it should be faster / more similar to the changes to iOS.
@SMBCheeky yes if this lib is a required part of your app I don’t see a way around downgrading for now. Even though there shouldn’t be any issues in theory if newArch was disabled (because there was none in this lib before RN 0.76 ie when newArch got enabled by default).
@ketanuengage I don’t want to commit to a timeline, this project is maintained only by me and the effort has exploded unexpectedly compared to the initial estimation, I would like to say end of the month to have a stable release but I was simply sick for two weeks recently, so too many variables. hopefully something will be shipped this weekend and we’ll see some momentum here again, this is the best I can offer.
Also thanks everyone for trying to moderate 😃 it’s really nice to see the community being supportive.
on that note, thanks @chyde and @r8 for the sponsorship 🚀🚀🚀🚀
@metkm Well, technically, reading isnt that hard for most people, I guess. but as a developer my brain is optimized for code, not sentences. and repeatedly said’ ? That implies a pattern, which is, like, totally different from just saying something once. plus, "he/she " ? ? That’s two things! My brain can only handle one pronoun at a time. my apologies, oh wise one. I didn’t realize that reading a whole thread was a prerequisite for being a developer. I thought we just, you know, copy-pasted code from stack overflow and hoped for the best.
@tantan39 @ketanuengage @ragasjohn there is no public release that solves the issue so far, it’s in progress but the change is massive and is taking lots of time and effort.
currently the example app for iOS both with apple and google maps work with Fabric as expected.
but with android the issue is not resolved, in fact we just got the app to build last week and slowly started migrating to support Fabric.
I’m very confused with the replies asking for “any updates” when the exact update was shared just couple of replies before yours.
anyhow.
I managed to push more code
it’s now available at: https://github.com/salah-ghanim/react-native-maps/tree/feat/mapview-newarch
it’s closer to what we want but not complete, more than 5k lines of code change so far but we’re not there yet for iOS. what is missing:
I don’t see a point of pushing for a beta without finishing the above 4. since the lib won’t be production ready.
regarding android, I haven’t taken a look yet.
so again please don’t use new-arch / Fabric for now with this library
https://github.com/react-native-maps/react-native-maps/compare/master...salah-ghanim:react-native-maps:feat/mapview-newarch
ok quick update after another deep dive into this topic for this week.
The bug is now limited to the MapView itself, not the subviews … I was able to create a very rudimentary MapView that works with new arch, and was able to display our Markers on it successfully.
here is the code: https://github.com/salah-ghanim/react-native-maps/tree/feat/mapview-newarch
Now this means that a full migration of the MapView to the new architecture should solve this issue.
Let’s see how to approach this.
I just want to say thank you @salah-ghanim and everyone contributing to this library. You guys are amazing.
Just a headsup, this have been taking exceptional effort on my side and we’re close to 10k lines of code in changes and still no end in sight (Android is not started yet).
I will do another last large push this weekend but most likely I will have to slow down afterwards.
@jordancam97 it’s not a solution to add views on top of the map, we need to fix the project.
new alpha version is released this weekend v1.21.0-alpha.58 it includes:
todos:
known issues:
hey @salah-ghanim did you fix Marker issue?
Yes the bug is reproducible, it seems like change propagation to native is not working as expected
Dude… read the thread.
@soufyen004 can you please delete/edit your comment about downgrading to RN 0.75. It looks official and may confuse others.
The main README of the repository already mentions the compatibility issue with new arch and references this issue.
Quick update, props are being passed to native successfully for iOS.
still I need to finish the implementation for complex props / type conversion and look into events
once done I will clean up the code and do a pull request and merge it so that people can test on iOS
if the problem is solved, we can look into android if really needed @YuriLima23
read a 200 items thread? no ty
@salah-ghanim What an amazing work you’re doing ! I’ve just discovered this library thinking to switch from web to some react native app and I read all this thread !
another version for the weekend v1.21.0-alpha.54 includes:
@fobos531 thanks for the testing and thanks for the sponsorship ❤️
new release is out v1.21.0-alpha.38 it includes:
another milestone release v1.21.0-alpha.49 it includes:
I’m seeing similar behavior and it appears to be related to the new arch support
Reading the thread as a developer shouldn’t be that hard. The package’s author repeatedly said that he/she hadn’t looked into Android support yet.
Great progress @salah-ghanim Maybe it makes sense to support only new architecture beginning from next major version?
@wojtekmaj thanks for suggesting this, start of a new year is definitely a good time to try something new.
I just did here: https://github.com/sponsors/salah-ghanim
At the very least, basic Android features—such as displaying markers—should function properly with the New Architecture, especially considering the significant progress made on iOS. Special thanks to @salah-ghanim for the continued support and efforts!
last release for the weekend: v1.21.0-alpha.22
latest confirmed known issues on iOS:
another version released v1.21.0-alpha.9
includes:
@fobos531 functions like takeSnapshot, pointForCoordinate / coordinatesForpoint … all should work for both now.
all feedback for the example app is welcome, I will update the todos list tonight, but I hope I can get started on Android soon. and I still see some new issues with Google Map such as markers are not always displayed.
@salah-ghanim I am happy to help and reached out to you by email.
as mentioned before the effort keeps expanding and the amount of time I can dedicate to this moving forward is limited https://github.com/react-native-maps/react-native-maps/compare/master...alpha 44 commits, more than 10k loc changes
thanks @daniel-xyz for the sponsorship 🚀🚀
@salah-ghanim Would you consider setting up GitHub Sponsors so we could at least have an option to say thank you?
also thanks everyone for reporting / support to solve this 😃
current known issues:
planned to tackle immediately:
did I miss anything ?
New day, new release: v1.21.0-alpha.18 includes:
@fobos531 (and anyone wanting to help with testing) would be nice if you can test all boolean properties, some might still not be working from what I see. you should be able to compare observed behaviour with the documentations.
Regarding Animation I believe that it can work without the need for ReAnimated, but more effort will be needed to make it work with Fabric natively, so I don’t plan on including it in the main release , instead a follow up release should be planned.
@roshan-ship-it it’s really exhausting to keep repeating myself, please stop spamming by repeating the same point that was mentioned times and times again. simply read before replying.
@Byloop yes that’s why we’re working on this as you can see
Ok so, I spent lots of time analysing this and the core reason is just how RCTLegacyViewManagerInterop layer is implemented, specifically a container view gets added in the view tree that works with new arch and this view is used in the react reconciliation process. And so only after rendering the parent view (MapView) the MarkerView is created and it never gets attached to the current view tree.
I was able to find a very hacky solution using swizzling but it didn’t solve all problems and it beaks apps with multiple mapviews
The way I see it, AirMap (and the google version of it) will need to be implemented in Fabric (new react native arch) for this to work… or each of the Map views (Marker, Overlay, Polygon …) so that we don’t have nested interopviews which is the root source of this issue.
if anyone wants to help please reach out, this looks like significant effort.
in the meantime please avoid updating to latest react-native if the functionality breaks for you, from what I see, if map state doesn’t change it seems like the Map will work as expected.
Then why comment and add to it when you don’t know it is the same issue as you clearly haven’t read it?
Subscribe to keep an eye on updates, and leave emojis to express agreement etc so as not to bother every subscribed person with irrelevant laziness /kick @Wei102193
@basitmir you’re welcome, thanks @transistorsoft for the sponsorship (10% target achieved !)
I will push this weekend to make sure the alpha package is packaged correctly, and if there are no more big issues on iOS I will priortize android so that we get basic support there as well 😃
+1 to same issue on android with new architecture
same issue on android with new architecture, any update ??
same issue, any update ??
Reading the whole thread is not a prerequisite for being a developer (as you say), but really is a prerequisite to add a coherent comment. As @adbl said, is not about the RN version, it’s about using or not the New Arquitecture.
@adbl I will look into properly adding expo support after being done with Android, but it should be relatively easy to get started testing with the example app. the instructions are here: https://github.com/react-native-maps/react-native-maps/blob/master/docs/examples-setup.md
@adbl thank you so much for the sponsorship 🥳
new version v1.21.0-alpha.47 is released that includes:
@fobos531 as usual I really appreciate your feedback.
regarding your feedback
it works, you need to select the marker (it jumps a bit on the screen) then you can drag it, on Google Maps the movement is more fluent
is it possible to test with an older version of the library with an older version of react-native (without Fabric) and compare the behaviour ?
fixed, thanks !
works as expected on apple, simple click the map and see a 100 marker being added. didn’t test Google.
it works on my side, but I see nothing changes with the polyline, looking at the code not sure if strokeColor make sense in the context of Polyline, I would leave it for now / possible to evaluate later against native google maps sdk on iOS and see if there is such behaviour.
I don’t see any issue, it’s loading markers as expected from KML.
fixed.
fixed, thanks !
Not really looking into this now.
⚙️ ~100 commit / 12k LoC changes so far
OK here, we go release v1.21.0-alpha.44 is out would appreciate the help testing the example app on iOS
the release includes:
From my point of view I managed to go through all examples aside from (caching and animation), all worked as expected for iOS Apple Maps and GoogleMaps.
Tomorrow hopefully we’ll have the first release for Android
Another major alpha release has arrived v1.21.0-alpha.28
it includes:
this release includes all examples working as expected for both Apple and Google Maps on iOS all the way to Fit Map To Coordinates except Marker and Mapview animations
@fobos531 and everyone else would be great if I get another round of feedback, we’re half way through the examples and my hope is that everything else will be faster for iOS.
ok finally I managed to get an alpha release out of the door here: v1.21.0-alpha.1
the latest changes included:
the commit message doesn’t do it justice, but this is the first alpha release (close to 5k line of code changes in total) https://github.com/react-native-maps/react-native-maps/compare/master...alpha
anyone with a react-native vanilla setup and an iOS app using default provider (apple MapKit instead of google) please test and tag me if you see something is not working as expected.
@elyobo yes I had to remove google-maps from the start due to build issues (I think google-maps isn’t happy with c/c++ mix) but I need to have a deeper look, I simply wanted to do a POC that Fabric works.
I know that some android issues were reported, I need to look into it as well and see if similar effort is needed.
and regarding expo, I’m no expert but I think if this lib works exactly as it used to (android, iOS, google and default providers) then it should work for expo
This discussion is long enough without going into support issues for older versions, but I would suggest trying development builds not expo go; we have to for a bunch of other reasons anyway, but that’s possibly the difference here.
@salah-ghanim this discussion is now huge and people are not reading the whole thing, leading to it growing even longer as they ask already answered questions; possibly editing the original issue, or your first comment, to include info on the current status (what is expected to work and what is not) would make that info more easily accessible to people just joining the discussion and head off that sort of redundant comment?
Same issue here
Also, if your company is using this library please consider sponsoring me, this library needs lots of maintenance and your company would benefit from all the updates. link here: https://github.com/sponsors/salah-ghanim
another major version and last one for the week v1.21.0-alpha.33
it includes:
known issues:
all examples below zIndex are not tested all examples above zIndex are working better than the last version we had before Fabric.
quick update: v1.21.0-alpha.3 is out
it includes the fix for android build
Hey, super grateful for your work here. I have a quite complex setup in my app, WIP upgrading to the new architecture so I’ll be more than happy to give it a go and come back with some feedback. Just @ me 😃
Partial alternative, go to your app’s build.gradle and set newArchEnable to false.
This is how I did mine pending when there’s is a permanent fix.
+1 to same issue on android with new architecture
another version for the weekend v1.21.0-alpha.60 it includes methods support:
reminder, if you use this project and want to see it working smoothly please consider sponsoring the work, this will help make the maintenance process more professional, and hopefully we can start adding features after releasing fabric link here: https://github.com/sponsors/salah-ghanim
@Nader-CS sigh… read the thread. Android is not supported yet. First focus is on making it work on IOS, then Android, then both on Expo
Expo is not yet working. Please read the rest of this thread.
+1
@iM-GeeKy I added the configuration file and now it works only the first time, that is, when I open the map for the first time after closing the app it works. If I continue the navigation and return, they no longer appear. I have to completely close the app and reopen it. The same happens if there is an hot reload.
Expo prácticamente te obliga con expo Go a pasar a SDK52 y react-native-maps no funciona. Un desastre…
same issue marker, circle andy my location only display on first render.
(NOBRIDGE) ERROR Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNMapsAirModule' could not be found. Verify that a module by this name is registered in the native binary. [Component Stack]getting this error when runing “react-native-maps”: “^1.21.0-alpha.53”, does anyone get this error too?@Adborowski did you rebuild your app after disabling new architecture? And did you ensure you added the line in the correct place?
Hi everyone, I’m having a bit of trouble with the map markers on Android. I’m not seeing them appear as I’d expect. I’m wondering if there might be something I’m missing or if there’s a potential issue with the Android implementation. Any insights you could provide would be greatly appreciated!
yes also discovered this issue but for circles/areas drawn onto the map. Not consistently showing on Android due to the newArchitecture.
Hey @salah-ghanim Below find my latest testing. I’ve tested all examples up until to the fit map to coordinates as you instructed.
Arbitrary Views as Markers example - not working in Apple Maps, displays regular marker instead of custom Draggable markers - also not working in Apple Maps, due to displaying regular marker
Also it seems like compass is not showing on Google Maps (it works fine on Apple Maps)
I can also confirm WMS & Custom tiles working. Z index on Apple Maps also works.
Everything else seems to work really well! Many thanks for this.
I am using 1.21.0-alpha.22 version and my build failed with error related to NativeAirMapsModule.
Hey @salah-ghanim thanks for the new release - below find my feedback from testing:
About the boolean properties testing:
First, I noticed that I’m unable to drag the map on ALL examples, both google and apple - I need to manually specify scrollEnabled as true to be able to drag the map, even though it says its true by default. Maybe the default is not being set properly?
Also, I noticed on Apple Maps that Im unable to drag default markers, only the custom one (this is in draggable markers example). In Google Maps both the default marker and the custom one can be dragged. Not sure if this behavior is intended.
<MapView /><Marker /><Polygon /><PolyLine />@salah-ghanim I’m not able to build the expo project with alpha package, not sure this is still an open issue. Error - Cause: No podspec found for
react-native-google-mapsin/users/......../node_modules/react-native-mapsHello, I am getting this error with the latest apha version for both IOS and Android I am using EXPO 52 “newArchEnabled”: true or false it doesn’t matter
I run my app through npx expo start
(NOBRIDGE) WARN Codegen didn’t run for RNMapsGooglePolygon. This will be an error in the future. Make sure you are using @react-native/babel-preset when building your JavaScript code. (NOBRIDGE) WARN Codegen didn’t run for RNMapsMarker. This will be an error in the future. Make sure you are using @react-native/babel-preset when building your JavaScript code. (NOBRIDGE) WARN Codegen didn’t run for RNMapsMapView. This will be an error in the future. Make sure you are using @react-native/babel-preset when building your JavaScript code. (NOBRIDGE) WARN Codegen didn’t run for RNMapsGoogleMapView. This will be an error in the future. Make sure you are using @react-native/babel-preset when building your JavaScript code.
Invariant Violation: TurboModuleRegistry.getEnforcing(…): ‘RNMapsAirModule’ could not be found. Verify that a module by this name is registered in the native binary.
A PR was merged in React Native to support Interop events on Android that are sent before the JS view is ready, such as during startup or with Android view pre-allocation.
This change is expected to be available in RN v0.79This change will be picked back to v0.76 to unblock folks using Interop layer on Android.Native map events, such as
onMapReady, which are emitted after initialization, need to be queued and emitted when the view is mounted if there is no event emitter ready. There is a mechanism to queue and emit these events upon view mounting via the SurfaceMountingManager.java.Until now, events emitted through the interop layer were not being queued properly. This fixes #5236, where the initial region is null when navigating back to the map. No more need for
setTimeoutto re-render the map.This change only affects the interop layer usage. If you are rewriting as Android Fabric components, the Fabric Event Emitter will queue the events correctly
cc @salah-ghanim
No need to downgrade. Simply navigate to your app’s build.gradle file and set newArchEnable to false until the issue is resolved.
This is why reviewing the entire thread is important—it helps you understand the issue, track progress, and explore possible workarounds.
@salah-ghanim , I have tried version v1.21.0-alpha.49 on android but I am facing following build error
error: cannot find symbol import com.facebook.fbreact.specs.NativeAirMapsModuleSpec; ^ symbol: class NativeAirMapsModuleSpec location: package com.facebook.fbreact.specs.
Thanks!
new version is out v1.21.0-alpha.15
Hey @salah-ghanim, took some time to test out the iOS Google Maps a bit with the example app, my findings below
null+1
Up on this, today I updated to Expo 52 and enabled new architecture. Markers, user location (the marker) and satellite map stopped working.
@elyobo I couldn’t agree more … That’s why I’ve created this discussion for a cleaner follow up ! 👀
@ragasjohn @Wei102193 Just have a read of the thread…
@murilopf-up Maybe you could rename your issue or add a disclaimer at the top of your post to prevent comments from people that didn’t read a single comment of this thread …
Otherwise @salah-ghanim maybe we can move this whole discussion into … This discussion
I am not sure if this is related, but I am having trouble with
<MapView>on Android. The first component is rendered properly, with all properties and markers etc. But any further instances just ignore props and child components, and instead render a default map as if it was not provided any props at all…@salah-ghanim This change in package.json changes
codegenConfig.jsSrcsDirto point to a directory that isn’t included in the package.This breaks codegen, probably works locally if you are using something like
npm link.When I patch
./src/specs->./lib/specsI encounter another problem:"react-native-maps-generated.podspec"and potentially"react-native-google-maps.podspec"seem to be missing fromfilesin package.json.Hello @salah-ghanim - Thank you for the work on the android side. Below find the results of my testing:
Static & Theme map - works Tracking Position - works Arbitrary Views as markers - works Events - crashes Image based markers - I think it works, not sure Draggable markers - works Polygon creator - crashes Polyline creator - not working Gradient polylines - crashes Gradient polylines functional - crashes Custom callouts - crashes Circles polygons and polylines - crashes Default markers - works Custom markers - the color is always red, doesn’t change Take snapshot - not working Cached map - works Map with loading - crashes Get visible map boundaries - not working Focus map on markers - working Fit map to coordinates - working Android lite map view - working Custom tiles - crashes WMS tiles - crashes Z-index - not working Update native props - crashes Custom overlay component - crashes KML - crashes Image overlay examples - crashing Animated map navigation - works POI click - crashes Indoor map - levels change works, but buttons to “go to level 5” and 1 do not work Camera control - working Massive custom markers - working Geo JSON - not sure Cache tiles - URL & WMS both crashing
@salah-ghanim great job but very hard to contribute. Iv’e refactored all the events for android as well and was already ready for a PR but it’s full off merge conflicts now.
I’ve had a couple of apps, all with newArchEnabled: false. As someone mentioned above, pins show up at the first render, but if I re-present the screen that includes the map, the pins disappear—and this is only in the release builds.
I’ve tried all marker implementations, making unique markers for every marker (22 markers x 2 (selected and not)) and setting the image directly on the map component + issues on how the initial region is set + how ref is handled… Realistically, issues started after adopting Expo 50-51 SDK-ish and the recommended versions of the associated react-native-maps versions.
Do you have any ideas on the next steps for this issue? Other than downgrading - as no one using expo will realistically want to do that 😃 no offense
Is there any known way that fixes this issue, for always seeing the markers?
Another large push today aiming to polish both Apple and Google Maps on iOS from my point of view, in the example app everything above create polygon works, for create polygon on GoogleMaps we have two visible issues:
the latest version: v1.21.0-alpha.14 includes: Example: Improve layout for “Tracking Position” Apple Maps: fix region and camera animations Apple Maps: correctly ‘ignore’ region change while animating Apple Maps: correctly recycle mapView Apple Maps: fix handling of initialRegion Apple-Maps: handle crash when error message is empty google-maps: region / camera changes working as expected google-maps: mark Tracking Position example as completed for iOS google-maps: marker Image: correctly assign iconView when image is loaded google-maps: mapType: fix bugs with type mapping google-maps: simple polygon works
@fobos531 thank you so much for all the support 😃 @Abdulmalick-Dimnang 1. thanks for pointing the lib issue / src was fixed in the last release @fobos531 please pay attention when testing example you will need to change it manually for now (or compile ts code manually). 2. regarding missing code, make sure you clean up your build dir and anything cached, pod install should cause codegen to run which in turn should generate the source code you see as missing.
@peefg again, no expo support for the current testing cycle, vanilla react-native or example app only please.
Just re-checked, it works for me now.
Fit to coordinates also works now. (log markers frames doesnt seem to log anything, but thats a smaller issue.)
Polyline creator also works now. (polygons still broken)
version 1.21.0-alpha.7 is out, it shows google-maps on iOS working, including:
@spsaucier @pennersr @LivioAlvarenga @softov @wasupak I have specifically said please test with vanilla react-native or with the example app
until we have the example app working on both android, iOS with both google and apple maps I can’t start looking in other integration issues.
I will update the above tasks list to match version 7.
testing support is still welcome 😃
Issue: Error After Updating
react-native-mapsto^1.21.0-alpha.6Description
After updating
react-native-mapsto version^1.21.0-alpha.6, I encountered the following error in my React Native project:This issue occurs both when running the app on Android Studio and using Expo Go on an iPhone. The error prevents the map components from functioning correctly.
Environment
0.76.5~52.0.23^1.21.0-alpha.6Request for Assistance
Could you please help identify the cause of this error and suggest potential solutions or workarounds? Any guidance on compatibility issues between
react-native-maps^1.21.0-alpha.6and the current versions of React Native and Expo would be greatly appreciated.another update v1.21.0-alpha.2 is out
@elyobo this should fix the issue you reported
@pennersr yes I see the issue in android build, I will investigate it.
@fobos531 you’re right the codgen config are now at lib level (at one point I used app level during early phases) and regarding the events issue, are you using google maps on iOS ? I don’t see such issues in the example project on iOS you can checkout the alpha branch and it should run out of the box locally with Fabric enabled.
@GilTRipper no the codegen code is correct, we just have issues with android build at the moment, see @pennersr’s comment.
@GilTRipper regarding your last commit please refine from sharing such short message that I can’t possibly debug or understand, if there is a reproducible error on your side with the alpha release please share all info needed to reproduce, look at our issue template for guidance.
at the moment I’m looking for feedback regarding the example project being run locally / fresh react-native-maps project with vanilla react-native, because we have so many clear issues with the setup still (hence the alpha) it doesn’t make sense to try and test it in your own project from my point of view or even with expo.
@spsaucier regarding RNMapsAirModule … you can see it in the source code in the repo. my guess would be that you have some build caching on your side (ether DerivedData folder or pods) you need to clean it up before testing.
Since my bug https://github.com/react-native-maps/react-native-maps/issues/5229 is closed as duplicate, I wanted to bring to your attention that the map initial region is also not working properly. The map center is correct, but the map bounds is way bigger than what it should be.
Maybe I can help with Android porting although I don’t know much about the bug fix. I develop react native on Android.
The map does not work for me also on iOS with react native 0.76.0. Don’t know if this is problem because of new architecture.
bump
For me, additionally, the markers children DO NOT render at all anymore,
when using SDK 52, the marker and direction won’t show out properly.
@janvacek
expo52.0.29withreact-native-maps1.18.0; usage is pretty simple, some markers and geojson, using Google Maps only on iOS and Android.It is explained in several places in the thread that expo is not supported yet.
I read the thread, but my problem persists and this issue is not found inside the thread, so I just added a new perspective. It is not a new issue it happens on the new alpha release as I said. Maybe is not happening to you but it happens to me .
Hello,
Can someone confirm that this PR fixes these two bugs :
(NOBRIDGE) ERROR Warning: TypeError: Cannot read property 'bubblingEventTypes' of nullon android-[__NSArrayM insertObject:atIndex:]: object cannot be nilon iOSThanks @salah-ghanim for all the awesome work you do
@pinpong yeah I know the diff is too huge, but if you share with me the code I can try to integrate it
Did you run
npx expo prebuild --cleanHey @salah-ghanim , to address your latest comment:
POI example now works on Google Maps Image overlay examples work as well. For Apple Maps draggable markers - thanks for the comment, I can move the stock marker, but I cannot move the custom marker still. Massive Custom Markers - my bad, works KML - yeah, wasn’t sure if the markers are supposed to be the KML, in that case all good.
EDIT: For polyline creator behavior, I tested on
main- it works fine there, I can see the polyline while I’m drawing it. I think it even worked on Fabric, but maybe got broken in one of the recent commits.Hello @salah-ghanim ,
went through all the examples again (aside from caching and animation), below are my findings:
Everything else seems to work nicely. Again, thank you for your continued work on this!
@salah-ghanim thanks for your hard work here, I’m following and cheering on from the side. 💪🤩
Looking to use the library for an upcoming app.
@mustafamoe yes, in
app.json:Alternatively, you could just remove the field entriely to disable it in 52. However, in 53, the new architecture will be the default, so explicitly setting it to
falsewill prevent issues if 53 releases before react-native-maps is ready (an unlikely, though possible, situation)https://docs.expo.dev/guides/new-architecture/#disable-the-new-architecture-in-an-existing-project
Hey @salah-ghanim,
Thanks so much for implementing the changes for Fabric - you’ve clearly been working hard on this.
I’ve been doing some testing with v1.21.0-alpha.22 in RN 0.76.6 (my own app, not example). This is more for those looking to install and test themselves, here’s what I’ve found so far:
yarn add react-native-maps@v1.21.0-alpha.22) compiles the .ts specs in /src/specs into .d.ts and .js - and these then fail the check for codegen files, and codegen reports that there are no modules for compilation. Probably worth excluding these files from TS compilation, so that they remain .ts when yarn installed.I’m continuing to work through this process. Let me know if this is valuable feedback, otherwise I’ll keep it to myself 😃
Thanks!
Ryan
Android build is failing for me.
log.txt package.json
Running on an apple silicone mac with java 21.
Hello @salah-ghanim I have added react native maps in my project and I am using version 1.20.1 and I am facing same issue with Marker. On first load of application Marker is displaying but when I again change screen and come back to map screen marker is not displaying.
Ah, that’s true @salah-ghanim - it did the trick. Below find my findings from the latest testing. I listed ONLY the things that don’t seem to work - so anything that’s not mentioned you could consider to be working.
Apple maps:
nullGoogle maps:
@fobos531 did you modify the root’s package.json so that
codegenConfig’s jsSrcsDir is : ./src/specs
because it seems like the c++ code wasn’t generated
@Resource-1 no one knows, the assumption by the react-native team to turn on Fabric by default assumed that libraries don’t ‘specially’ manage the adding / removing of subviews . or are nested. this is not the case with this library and I struggle to find similar examples online.
a rewrite is needed for any view that includes:
good news is that both MapView itself for iOS’s Apple Maps and Google Maps are stable now from my point of view. not so good news, is that I still need to work on the subviews (such as Polygon) in Google Maps to make them work correctly.
the problem is that this is a library being used by so many, so we can’t aim for a non-complete public release, so we have to fix all / finish the implementation before releasing anything public.
So when can we expected to be work with expo ?
The alpha does not work with EXPO for now, as stated several times above.
Hey @salah-ghanim - no worries, I’d also like to say thanks for the incredible effort you’re putting into this - feel free to take all the time you need to complete this, and please let us know if there’s anything we can do to support you in this migration.
With that said, I tried running the latest commit on the
alphabranch, and I’m getting a bunch of compile errors@salah-ghanim Hello Sir! I just wanted to say that I’ve been following this thread for a while, and your efforts are wonderful. Thank you as a maintainer for helping to take care of this project and get it working for New arch.
Hello @salah-ghanim - I cannot comment on the specs issues (although they’re definitely something to look at), but by testing from my last comment, the changes are:
Google maps:
I haven’t tested other stuff.
hi @salah-ghanim
I wanted to leave this feedback with the latest alpha version
v1.21.0-alpha.12and so far, still facing issues with running the appI have tested using the following (fresh project “non-expo” using
npx @react-native-community/cli@latest init ProjectName)then ran the followings
then getting the following error still
According to the above comments, it’s fixed but I still see the path still uses
srcinstead oflibin package.json as followsSo i had to patch the package to use
liband after runningbundle exec pod installit was successfully installed but build is failing as followsThen added pod installation according to the example but it fails with
Kindly do let us know if we’re missing a step ❤️
Hello @salah-ghanim, on the latest release, I get the following build error:
version v1.21.0-alpha.8 is out, it includes:
@fobos531 I can’t confirm that Draggable Markers is not working, it is functioning
thanks for all the other feedback, will go through it to confirm and add it to the open points list
Hey @salah-ghanim
Thanks for the new release. I went ahead and tested a few things. Since @pennersr mentiones that codegen fails for them, I once again added “src” to the package.json and compiled like that, and I can confirm that the app successfully builds for me like this. You mentioned bubbling event issues for Google Maps on iOS, but it is possible that they’re happening on Android as well, since I’m getting this on Android:
The event issue I mentioned before is also still present in my app. Its a simple mapview with a
onRegionChangeCompletedefined, which I assume is causing the error.And I still get this error for codegen not running:
(NOBRIDGE) WARN Codegen didn't run for RNMapsMapView. This will be an error in the future. Make sure you are using @react-native/babel-preset when building your JavaScript code. [Component Stack]I’m pretty sure this is all related to the Codegen config being incomplete or incorrect, but I’m not knowledgeable enough to be able to say what exactly.
However, I did try to run the example in your repo, and I can confirm that the app builds successfully on iOS without any other changes, and events/callbacks work perfectly for Apple Maps.
Hey @salah-ghanim
Thank you for the superb work on the migration! I tried the v1.21.0-alpha.1 version you shared, and it seems like Codegen has an issue with the specs
You can see that the src folder isn’t even present in the installed node module
I would say you need to add
srcto thefilesarray in the package.json:I’m facing the same error. “react-native-maps”: “^1.18.0”, “react-native”: “0.76.5”, When I build for iOS, I get an error. Is there currently no way to resolve this issue?
I’ve been trying to test that branch via https://github.com/spsaucier/react-native-maps/tree/feat/mapview-newarch (includes the lib folder) but getting this error:
I was directed here from this issue. As a solution to this problem, it has been suggested to use an older version of the library. Could you please specify which combination of library versions has been confirmed to work?
Hey, Thanks for your hard work. Just a quick question. Will the new arc also make custom markers faster? Maybe on par with default markers?