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)

Most upvoted comments

@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:

  • codegen working and build working for android and iOS
  • Fabric Map on Android
  • Fabric Marker on Android
  • support for very few properties / events

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:

  1. finish all events (should be easiest / done this weekend)
  2. finish visible commands interface (setCamera, region …)
  3. finish “hidden” commands interface such as pointForCoordinate/ getAddressFromCoordinates
  4. bug in markers update, most likely Markers need to be migrated to Fabric as well.

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:

  • finally correctly initialising Fabric Google Map on Android.
  • fix for onRegionChange on android
  • some examples are already working including Arbitrary Marker view example

todos:

  • go through the examples and fix each broken one

known issues:

  • android methods are not implemented yet fitMarkers, moveCamera …
  • Events for Callout, GeoJson and other components are causing crash.

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

hey @salah-ghanim did you fix Marker issue?

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 !

  1. Keep it up with that work 🚀 💪
  2. Thanks a LOT ❤ (and @fobos531 too) from all silents readers !
  3. Don’t even bother answering those that didn’t read and commenting only for expo

another version for the weekend v1.21.0-alpha.54 includes:

  • android: passing many Map props to Fabric Map
  • android: handle NPE due to a race condition where props where being set before map is ready

@fobos531 thanks for the testing and thanks for the sponsorship ❤️

new release is out v1.21.0-alpha.38 it includes:

  • Apple Maps: fix for race condition for setInitialCamera / region for recycled views.
  • Apple Maps: fix Draggable and Arbitrary markers (correctly re-initialize recycled views)
  • Google Maps: fix crash for getCamera
  • Google Maps: showCompass is working as expected
  • Apple Maps: improve set camera to handle altitude property

another milestone release v1.21.0-alpha.49 it includes:

  • reworked codegen logic so that it’s packaged in the repo and doesn’t need to be done at build time.
  • fix android build and correctly connect to the generated code
  • introduced a new pod “react-native-maps-generated” that will be required always from now on.
  • updated example project Podfile to include the new pod

I’m seeing similar behavior and it appears to be related to the new arch support

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!

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

  • Markers commands are working including animatingMarker coordinates

latest confirmed known issues on iOS:

  • AppleMaps: can’t move the map with gestures (feedback cycle to onRegionChange causes region prop to update)
  • AppleMaps: show callout is not functioning as expected (‘appears’ twice because marker gets selected)
  • GoogleMaps: circles, Polygons, and Polylines example doesn’t show Circle
  • AppleMaps: custom marker example not working as expected

another version released v1.21.0-alpha.9

includes:

  • enable NativeModule logic for GoogleMaps
  • unify Module interface for both Apple and Google
  • improve callback responses to be similar
  • add backward support for Bridge Mode

@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 🚀🚀

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.

@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:

  • GoogleMaps id is not being passed on iOS: https://github.com/react-native-maps/react-native-maps/issues/5250
  • Bubbling event issues on iOS (google maps)
  • Build issues on android
  • incorrect adding / removing markers on google maps iOS (same issue described above)
  • iOS GoogleMaps: bubbling event (type mismatch) blocking app
  • iOS GoogleMaps: crash when an error happens while getting userLocation
  • iOS GoogleMaps: customMarkers not visible (subviews for a marker)
  • iOS GoogleMaps: Image marker not visible
  • iOS Map Region / camera animations not working correctly
  • iOS GoogleMaps: mapType incorrectly mapped
  • iOS Apple Maps: correctly recycle MapView
  • iOS GoogleMaps: basic support for Polygons.
  • iOS GoogleMaps: Rework Polygons to use Fabric to avoid the same issue with Markers described here.
  • iOS GoogleMaps: not all commands are working (takescreenshot, zoomToFit …)
  • incorrect adding / removing markers on android (same issue described above)

planned to tackle immediately:

  • android build
  • ios google-maps support similar to apple maps

did I miss anything ?

New day, new release: v1.21.0-alpha.18 includes:

  • Fix for Polyline and Polyline gradient examples
  • Fixes for panEvent that was missing
  • fixes for some native flags (scrollEnabled, handlePanDrag)
  • Animation examples are disabled for now / not crashing anymore

@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

// AirMap.m
- (void)didMoveToSuperview {
    [super didMoveToSuperview];
    
    Class legacyViewManagerClass = NSClassFromString(@"RCTLegacyViewManagerInteropComponentView");
    if (legacyViewManagerClass && [self.superview isKindOfClass:legacyViewManagerClass]) {
        [self.superview setValue:self forKey:@"associatedMapView"];
        [self interceptMountChildComponentViewInSuperview];
        [self interceptUnmountChildComponentViewInSuperview];
    }
}


- (void)myCustom_mountChildComponentView:(UIView *)childComponentView index:(NSInteger)index {
    NSLog(@"myCustom_mountChildComponentView");
    
    // Call the original method using the stored function pointer
    if (originalMountChildComponentView) {
        originalMountChildComponentView(self, _cmd, childComponentView, index);
    }
    
    // Check if the childComponentView has a paperView
    SEL paperViewSelector = NSSelectorFromString(@"paperView");
    UIView *paperView = nil;
    if ([childComponentView respondsToSelector:paperViewSelector]) {
        paperView = [childComponentView valueForKey:@"paperView"];
    }
    
    // Only trigger finalizeUpdates if paperView exists
    if (paperView) {
        SEL finalizeUpdatesSelector = NSSelectorFromString(@"finalizeUpdates:");
        if ([self respondsToSelector:finalizeUpdatesSelector]) {
            NSInteger updateMask = 15; // Value for RNComponentViewUpdateMaskAll
            NSMethodSignature *signature = [self methodSignatureForSelector:finalizeUpdatesSelector];
            NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
            [invocation setSelector:finalizeUpdatesSelector];
            [invocation setTarget:self];
            [invocation setArgument:&updateMask atIndex:2];
            [invocation invoke];
        } else {
            NSLog(@"finalizeUpdates: selector not found.");
        }
    } else {
        NSLog(@"paperView not found, skipping finalizeUpdates.");
    }
}

- (void)myCustom_unmountChildComponentView:(UIView *)childComponentView index:(NSInteger)index {
    NSLog(@"myCustom_unmountChildComponentView");
    
    // Call the original method using the stored function pointer
    if (originalUnmountChildComponentView) {
        originalUnmountChildComponentView(self, _cmd, childComponentView, index);
    }
    
    // Check if the childComponentView has a paperView
    SEL paperViewSelector = NSSelectorFromString(@"paperView");
    UIView *paperView = nil;
    if ([childComponentView respondsToSelector:paperViewSelector]) {
        paperView = [childComponentView valueForKey:@"paperView"];
    }
    
    // Only trigger finalizeUpdates if paperView exists
    if (paperView) {
        SEL finalizeUpdatesSelector = NSSelectorFromString(@"finalizeUpdates:");
        if ([self respondsToSelector:finalizeUpdatesSelector]) {
            NSInteger updateMask = 15; // Value for RNComponentViewUpdateMaskAll
            NSMethodSignature *signature = [self methodSignatureForSelector:finalizeUpdatesSelector];
            NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
            [invocation setSelector:finalizeUpdatesSelector];
            [invocation setTarget:self];
            [invocation setArgument:&updateMask atIndex:2];
            [invocation invoke];
        } else {
            NSLog(@"finalizeUpdates: selector not found.");
        }
    } else {
        NSLog(@"paperView not found, skipping finalizeUpdates.");
    }
}

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.

read a 200 items thread? no ty

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 ??

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.

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:

  • Apple Maps: Fix crash when clicking on callout sometimes (missing redraw, redraw callout impl).
  • Overlay: fix of mapping for the Image prop to native (seems like Fabric is more strict with data types)
  • Google Maps: added support for onPoI Click

@fobos531 as usual I really appreciate your feedback.

regarding your feedback

draggable markers on Apple Maps - this example didnt work for me, I wasn’t able to drag either the standard or the custom marker

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

polyline creator on Apple Maps - works, but I cannot see the line while I’m drawing it, only after I lift the finger I see it I think that’s the expected behaviour, but I can priortize moving those components to Fabric one by one afterwards.

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 ?

custom callouts on Apple Maps - when I tap the callout of the bottom right marker, the app crashes (other callouts are fine)

fixed, thanks !

image overlay component with URL on Apple Maps - not working fixed, thanks!

image overlay component with Bearing - nothing renders fixed, thanks !

MassiveCustomMarkers on Apple Maps and Google Maps- nothing happens

works as expected on apple, simple click the map and see a 100 marker being added. didn’t test Google.

Update native props with Google Maps - the color of the polyline doesn’t change

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.

KML with Google Maps - not sure where I should be looking at, but doesn’t load for me

I don’t see any issue, it’s loading markers as expected from KML.

Image

Image overlay component with custom URL/Bearing - nothing renders

fixed.

On Poi click on Google Maps - not sure if I’m doing it correctly, but nothing happens when I click on the built-in POIs

fixed, thanks !

Cached WMS tiles on Google Maps - they don’t seem to be rendered

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:

  • Apple Maps: fix crash when setCamera is called with nil camera
  • Apple Maps: fix map region initialisation when nothing is provided.
  • GoogleMaps: zIndex working properly for Markers, Polygon and Circle
  • GoogleMaps: fix KML Loading
  • Examples: Google Maps, remove deprecated styles JSON example. please use Google MapID for now.
  • Examples: fix UI for update native props example

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:

  • Apple + Google Maps: migrating to this.map.setRegion instead of using region prop when we’re receiving region from native constantly (gestures / animation …)
  • Apple + Google Maps: screenshot now is working for both Google and Apple Maps (was broken before)
  • Apple Maps: Image markers and other marker features are working as expected.
  • Apple Maps: Correctly show / hide callout
  • Google Maps: fix default values to work correctly (zoomEnabled, scrollEnabled …)
  • Google Maps: fix circle display

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:

  • fix for flicker issue for Markers with custom views.

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?

I believe the issue I am facing is related to this problem. However, could it be a different issue? (I am using Markers and Polylines on a map display, but I am encountering errors when trying to display them.)

Image

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:

  • Apple Maps: add support for displayPriority (needed for zIndex example)
  • Apple Maps: fix z-index handling
  • Google / Apple Maps: WMSTiles load (broken visual but works)
  • Google / Apple Maps: custom tiles work (openstreetmaps tiles)
  • Apple Maps: MapBoundaries example working (and refactor)
  • Apple Maps: Cache enabled example working (but crashes due to memory pressure after scrolling)
  • Apple Maps: Add hack to handle high memory pressure to release Map tile caches

known issues:

  • GoogleMaps: zIndex not working

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:

  • animateCamera
  • animateToRegion
  • fitToElements
  • fitToSuppliedMarkers
  • fitToCoordinates
  • setCamera
  • getCamera

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

Android build is failing for me.

log.txt package.json

Running on an apple silicone mac with java 21.

Expo is not yet working. Please read the rest of this thread.

+1

I’m seeing similar behavior and it appears to be related to the new arch support

@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?

{
  "expo": {
    "newArchEnabled": false,
  }
}

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.

hey @salah-ghanim did you fix Marker issue?

I am using 1.21.0-alpha.22 version and my build failed with error related to NativeAirMapsModule.

New day, new release: v1.21.0-alpha.18 includes:

  • Fix for Polyline and Polyline gradient examples
  • Fixes for panEvent that was missing
  • fixes for some native flags (scrollEnabled, handlePanDrag)
  • Animation examples are disabled for now / not crashing anymore

@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

Hey @salah-ghanim thanks for the new release - below find my feedback from testing:

  • Polygon creator Google Maps iOS - seems to work now, even holes
  • Polyline creator Google Maps iOS - confirmed working as intended
  • Gradient polylines - working in both Google and Apple Maps

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 />

  • showsUserLocation - works
  • followsUserLocation - unable to test (can’t go outside and test right now)
  • userLocationCalloutEnabled - works, shows a default callout (person icon)
  • showsMyLocationButton - not working (both on apple and google)
  • showsPointsOfInterest - no effect, they are still displayed even if false
  • showsCompass - not working at all - it is never shown even if true
  • showsScale - not working at all - it is never shown even if true
  • showsBuildings - works
  • showsTraffic - works
  • showsIndoors - works
  • showsIndoorLevelPicker - works
  • zoomEnabled - not working, I can zoom even if zoom is disabled
  • zoomTapEnabled - not working, I can zoom even if zoom is disabled
  • rotateEnabled - working on Google, not working on Apple
  • scrollEnabled - works
  • scrollDuringRotateOrZoomEnabled - not working, I can still scroll while rotating/zoomign
  • pitchEnabled - not working, I can still tilt the map even when disabled
  • loadingEnabled - works on Apple, not sure if the feature is present on Google

<Marker />

  • flat - I don’t understand this prop - I don’t see any difference in true/false
  • tappable - not working, onPress is still fired even if false
  • stopPropagation - not working, onPress of Map is still fired even if false
  • isPreselected - not working - the marker is not in “active” state (i.e. enlarged)

<Polygon />

  • tappable - not working, onPress is fired even if false

<PolyLine />

  • tappable - working on Google maps, not working on Apple

@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-maps in /users/......../node_modules/react-native-maps

Hello, 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.79 This 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 setTimeout to 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

Hello everyone,

[IMPORTANT] React Native Maps Issues on Newer Versions - Downgrade to 0.75.0

It appears there are ongoing issues with react-native-maps on recent React Native versions beyond 0.75.0, leading to various bugs and unexpected behavior. This is a known problem, and while a proper fix is being worked on, a reliable temporary solution is to downgrade your React Native version to 0.75.0.

If you’re encountering issues with react-native-maps, please consider downgrading to React Native 0.75.0 as a workaround.

This has proven to resolve many of the reported problems.

Please Note:

  • This is a temporary workaround. We will update this thread with information as a permanent fix or compatible version of react-native-maps becomes available.
  • After downgrading, you may need to clear your cache, node_modules folder, etc. to ensure a clean installation.
  • If you’re still experiencing issues after downgrading, please provide detailed information about your environment (including OS, React Native version, react-native-maps version) and the specific error or unexpected behavior you’re encountering.

We understand this is not ideal, but this step will help many get their maps working correctly in the meantime.

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

  • Polygons support for GoogleMaps iOS

version 1.21.0-alpha.7 is out, it shows google-maps on iOS working, including:

  • update react-native to 0.76.5
  • googleMapId is being passed correctly
  • fix build issues for framework iOS builds where cross dependencies imports where causing problems when c++ was introduced to react-native-google-maps
  • iOS examples app is correctly adding markers (solving this exact issue)
  • bubbling event issue for GoogleMaps iOS is gone as well (correct type is used)

@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 😃

Hey @salah-ghanim, took some time to test out the iOS Google Maps a bit with the example app, my findings below

  • “animate (region)” in “Tracking Position” may not be working - it just jumps around on the map, while the animate coordinate and animate bearing have a nice animation.
  • “arbitrary views as markers example” - I don’t see custom views rendered anywhere, and the - + buttons to zoom on the map do not work.
  • “Events” - this seems to work, although I haven’t tested ALL events.
  • Image based markers - not rendering
  • Draggable Markers - not rendering
  • Polygon Creator & Polyline Creator - not rendering
  • Gradient polylines examples - not rendering + this error:
 (NOBRIDGE) ERROR  Warning: Can't call setState on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the GradientPolylines component.
    in GradientPolylines (created by App)
    in RCTView (created by View)
    in View (created by App)
    in App
    in RCTView (created by View)
    in View (created by AppContainer)
    in RCTView (created by View)
    in View (created by AppContainer)
    in AppContainer
    in rnmshowcase(RootComponent)
  • Custom callouts - not working due to markers not rendering
  • Circles, Polygons and Polylines - not rendering
  • Default Markers - successfully rendering
  • Custom markers - not rendering
  • Take snapshot - no feedback (likely not working)
  • Map with loading - no feedback (likely not working)
  • Get visible map boundaries - returning null
  • Focus map on markers - working, but huge delay of multiple seconds
  • Fit map to Coordinates - not working (logging markers frames works)
  • Image overlays - not working
  • Indoor maps - not working
  • Camera control - nothing happens when buttons are pressed
  • Massive markers example - nothing happens when map is tapped to create markers
  • KML example - not rendering
  • Custom overlay component - working
  • Reposition legal label - nothing happens when “animate” is pressed

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.jsSrcsDir to point to a directory that isn’t included in the package.

-    "jsSrcsDir": "./lib/specs",
+    "jsSrcsDir": "./src/specs",

This breaks codegen, probably works locally if you are using something like npm link.

When I patch ./src/specs -> ./lib/specs I encounter another problem:

[!] Unable to find a specification for `react-native-maps-generated` depended upon by `react-native-maps`

"react-native-maps-generated.podspec" and potentially "react-native-google-maps.podspec" seem to be missing from files in 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:

  1. similar to this issue polygon is one render cycle before the user interactions.
  2. crash regarding holes (clear why).

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.

version v1.21.0-alpha.8 is out, it includes:

  • Commands working (some might still be missing) for both google and apple
  • multiple fixes

@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

I can’t confirm that Draggable Markers is not working, it is functioning

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:

  • update react-native to 0.76.5
  • googleMapId is being passed correctly
  • fix build issues for framework iOS builds where cross dependencies imports where causing problems when c++ was introduced to react-native-google-maps
  • iOS examples app is correctly adding markers (solving this exact issue)
  • bubbling event issue for GoogleMaps iOS is gone as well (correct type is used)

@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-maps to ^1.21.0-alpha.6

Description

After updating react-native-maps to version ^1.21.0-alpha.6, I encountered the following error in my React Native project:

(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]

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

  • React Native: 0.76.5
  • Expo: ~52.0.23
  • react-native-maps: ^1.21.0-alpha.6
  • Development Tools: Android Studio, Expo Go (iOS)

Request 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.6 and the current versions of React Native and Expo would be greatly appreciated.

another update v1.21.0-alpha.2 is out

  • google-maps-ios is added again to the code and is working with the example

@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 expo 52.0.29 with react-native-maps 1.18.0; usage is pretty simple, some markers and geojson, using Google Maps only on iOS and Android.

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 .

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 null on android -[__NSArrayM insertObject:atIndex:]: object cannot be nil on iOS

Thanks @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

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?

Did you run npx expo prebuild --clean

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

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:

  • Apple Maps: fix crash when setCamera is called with nil camera
  • Apple Maps: fix map region initialisation when nothing is provided.
  • GoogleMaps: zIndex working properly for Markers, Polygon and Circle
  • GoogleMaps: fix KML Loading
  • Examples: Google Maps, remove deprecated styles JSON example. please use Google MapID for now.
  • Examples: fix UI for update native props example

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

Hello @salah-ghanim ,

went through all the examples again (aside from caching and animation), below are my findings:

  • draggable markers on Apple Maps - this example didnt work for me, I wasn’t able to drag either the standard or the custom marker
  • polyline creator on Apple Maps - works, but I cannot see the line while I’m drawing it, only after I lift the finger I see it
  • custom callouts on Apple Maps - when I tap the callout of the bottom right marker, the app crashes (other callouts are fine)
  • image overlay component with URL on Apple Maps - not working
  • image overlay component with Bearing - nothing renders
  • MassiveCustomMarkers on Apple Maps and Google Maps- nothing happens
  • Update native props with Google Maps - the color of the polyline doesn’t change
  • KML with Google Maps - not sure where I should be looking at, but doesn’t load for me
  • Image overlay component with custom URL/Bearing - nothing renders
  • On Poi click on Google Maps - not sure if I’m doing it correctly, but nothing happens when I click on the built-in POIs
  • Cached WMS tiles on Google Maps - they don’t seem to be rendered

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:

{
  "expo": {
    "newArchEnabled": false
  }
}

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 false will 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:

  1. Installing with Yarn (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.
  2. Downloading the source and manually linking via Yarn works! I had to modify the package.json to point to the /src/specs folder for codegen The TS code is picked up from the /src/specs
  3. Build fails with RNMapsMarkerView.h not found (imported in RNMapsMapView.m)

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.

@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:

  1. complex prop types (array of arrays for example)
  2. custom subviews

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.

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:

  • polyline creator - doesn’t seem to work
  • gradient polylines - nothing’s rendered
  • animating with map views - crashing
  • animated marker position - crash/error
  • take snapshot - nothing happens
  • cached map - example not usable
  • get visible map boundaries - returns null
  • custom tiles - nothing’s rendered
  • wms tiles - nothing is rendered
  • image overlay component with URL - nothing rendered
  • image overlay with bearing - not working
  • on Poi Click - nothing happens when POI is clicked
  • massive custom markers - nothing happens when markers are created
  • geo json - not working (not sure if even supported)

Google maps:

  • polygon creator - crashes when creating holes
  • polyline creator - map moves when creating polyline
  • circles polygons and polylines - circles not rendered
  • take snapshot - nothing happens
  • custom tiles - nothing’s rendered
  • wms tiles - nothing is rendered
  • update native props - props are not updated
  • kml - nothing is rendered
  • image overlay component with URL - nothing rendered, maybe an issue with the example
  • on Poi Click - nothing happens when POI is clicked
  • camera control - crashes
  • massive custom markers - nothing happens when markers are created
  • geo json - not working (not sure if even supported)

@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:

  1. complex prop types (array of arrays for example)
  2. custom subviews

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.

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.

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 alpha branch, and I’m getting a bunch of compile errors CleanShot 2025-01-02 at 11 30 12@2x

@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:

  • massive markers example - working
  • arbitrary views as markers - working
  • image based markers - working
  • draggable markers - working
  • polyline creator example - working, but small issue - when I’m drawing a line, the map moves as well, it should be frozen when the line is being drawn
  • polygon creator - doesn’t seem to work
  • gradient polylines functional - working
  • custom callouts - working
  • circles, polygons and polylines - I can only see polylines, no circles or polygons
  • default markers - working
  • custom markers - seems to work
  • take snapshot - nothing happens
  • get visible map boundaries - working
  • fit map to coordinates - working
  • custom tiles - not working
  • WMS tiles - not working
  • markers with z index - seems to work
  • custom overlay component - working
  • KML - not working
  • image overlay component with assets - working
  • image overlay component with URL - not working
  • image overlay with bearing - not working
  • on POI click - not working
  • indoor map - working
  • camera controls (Get current camera) - crashes

CleanShot 2025-01-01 at 19 55 02@2x

I haven’t tested other stuff.

hi @salah-ghanim

I wanted to leave this feedback with the latest alpha version v1.21.0-alpha.12 and so far, still facing issues with running the app

I have tested using the following (fresh project “non-expo” using npx @react-native-community/cli@latest init ProjectName)

"dependencies": {
  "react": "18.3.1",
  "react-native": "0.76.5",
  "react-native-maps": "^1.21.0-alpha.12"
},

then ran the followings

  • bundle install
  • cd ios && bundle exec pod install

then getting the following error still

errno: -2,
syscall: 'lstat',
code: 'ENOENT',
path: '/PATH_TO_PROJECT/GoogleMap2/node_modules/react-native-maps/src/specs'

According to the above comments, it’s fixed but I still see the path still uses src instead of lib in package.json as follows

"codegenConfig": {
  "name": "RNMapsSpecs",
  "type": "all",
  "jsSrcsDir": "./src/specs",
  "android": {
    "javaPackageName": "com.rnmaps.fabric"
  }
},

So i had to patch the package to use lib and after running bundle exec pod install it was successfully installed but build is failing as follows Screenshot 2025-01-01 at 4 57 27 PM

Then added pod installation according to the example but it fails with

[!] No podspec found for `react-native-google-maps` in `../node_modules/react-native-maps`
rn_maps_path = '../node_modules/react-native-maps'
pod 'react-native-google-maps', :path => rn_maps_path
pod 'react-native-maps', :path => rn_maps_path

Kindly do let us know if we’re missing a step ❤️

Hello @salah-ghanim, on the latest release, I get the following build error:

CleanShot 2024-12-29 at 21 05 56@2x

version v1.21.0-alpha.8 is out, it includes:

  • Commands working (some might still be missing) for both google and apple
  • multiple fixes

@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:

 (NOBRIDGE) ERROR  Warning: TypeError: Cannot read property 'bubblingEventTypes' of null

This error is located at:
    in AIRMap (created by MapView)
    in MapView
    in Unknown
    in RCTView (created by View)
    in View (created by MapScreen)
    in MapScreen
    in Unknown (created by Route(map))
    in Suspense (created by Route(map))
    in Route (created by Route(map))

The event issue I mentioned before is also still present in my app. Its a simple mapview with a onRegionChangeComplete defined, 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 CleanShot 2024-12-23 at 10 42 50@2x

You can see that the src folder isn’t even present in the installed node module

CleanShot 2024-12-23 at 10 44 50@2x

I would say you need to add src to the files array in the package.json:

CleanShot 2024-12-23 at 10 45 14@2x

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:

Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNMapsAirModule' could not be found. Verify that a module by this name is registered in the native binary., js engine: hermes

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?

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.

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?