-
-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for RN New Architecture #436
Comments
@Avadon You are going to have better luck running 10.0.0 (10.0.0-alpha.10) with recent versions of react and react-native, as the 10.0.0 is using the latest native sdk libraries. The 9.0.0 codebase is quite old. Although, even 10.0.0 may not yet work with the new architecture. I wouldn't be surprised if that required some library changes. |
I get the same error message on Android and iOS, even with the newest version 10.0.0-alpha.22 and RN 0.74.5:
The error happens on the import. Edit: Even with RN 0.72.17 I get these errors. |
I also encounter this problem on Android with the version 10.0.0-alpha.22 "EarlyJsError: Cannot read property 'StyleURL' of null stack: anonymous@104461:35" |
Could one of you create a reproduction repository? |
I'd suggest we branch the repo and update packages/expo-app to enable the new arch. That's probably the fastest way to see what breaks and debug it.
|
https://github.com/ElSeniorMikael/maplibre-android-error There is my repo with the actual android problem i'm facing |
Got it working. :) 2 weeks ago I had the following error messages:
I fixed the first one by using the command The second was due to incompatible versions of various packages. I have fixed it by running The command And maybe you need also the command |
I'm currently on the 10.0.0-alpha.23 version. Got it working by:
=> Is this working with the old arch ?
=> I guess changes are okay for the old arch
=> Need to make conditions to make it backwards compatible Here is the diff:
I think I will use |
Thanks, I also played around a bit and I think I was missing the object spread. See also #481. There the UIManager was switched to: mEventDispatcher = UIManagerHelper.getUIManager(context, UIManagerType.FABRIC).getEventDispatcher(); Migration is documented as: if(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
UIManager uiManager = UIManagerHelper.getUIManager(this.reactContext, UIManagerType.FABRIC);
} else {
UIManagerModule uiManager = this.reactContext.getNativeModule(UIManagerModule.class);
} |
This is awesome! Are additional changes to #481 required? It would be great if we could get a PR with these changes, and configure packages/expo to use the new architecture. I'd probably keep packages/react-native on the previous architecture so we can ensure backwards compatibility. |
Upgrading to the latest RN version breaks Android runtime with an error
Native part of Mapbox React Native libraries were not registered properly, double check our native installation guides.
due to native module is not loading (even thought RN interoperability layer should keep legacy native modules working)I assume the error happens somewhere here:
https://github.com/maplibre/maplibre-react-native/blob/main/javascript/components/MapView.tsx#L33
Steps to Trigger Behavior
react-native run-android
Expected Behavior
A running Android app
Actual Behavior
An error
Native part of Mapbox React Native libraries were not registered properly, double check our native installation guides.
Screenshots (if applicable)
https://i.ibb.co/hW2gSWS/Screenshot-2024-09-05-at-18-15-49.png
Version(s) affected
The text was updated successfully, but these errors were encountered: