Closed bllanos closed 2 months ago
@bllanos can you get it working with old arch? Are you running yarn start
from the example directory?
Does r
or d
on the metro side/example app does anything?
Note sure why you don't see this error on the metro side: TypeError: _index.default.setAccessToken is not a function (it is undefined)
I am running yarn start
from the example directory. In the Metro bundler, d
opens the debug menu as usual, and r
reloads the app (which does not resolve the error).
On the old React Native architecture, broadly speaking the example app is functional, but the contrast is poor (see screenshot) and there are some errors and warnings that appear in different pages. For example, the "Most recent" menu item at the top of the home page results in Error: error:Expected item not group|undefined! path:React Native Mapbox,Most recent item:[object Object]
when tapped. I can see and interact with most of the samples, though.
My device uses dark mode, by the way, if that affects the colour scheme.
@bllanos for the new architecture -
bridgelessEnabled=false needs to be used for now.
See https://github.com/rnmapbox/maps/compare/disable-bridgeless-on-android?expand=1
I tested branch disable-bridgeless-on-android
(#3526, commit 06b063da2411ecbc09e587f5d51526b0ad95a62d
) with the new React Native architecture enabled. The example app renders successfully, but it seems like it is still not able to find most Mapbox functions. For example, in the User Location > Set Tint Color example, I see the following warning on opening the page:
Strangely, I do not see this warning either output by the Metro bundle server, or in Logcat.
Next, if I tap on the 'yellow' button, there is an error instead of a warning:
Error: Exception in HostFunction: no non-static method "Lcom/rnmapbox/rnmbx/components/mapview/NativeMapViewModule;.setHandledMapChangedEvents(Ljava/lang/Double;Lcom/facebook/react/bridge/ReadableArray;Lcom/facebook/react/bridge/Promise;)V"
This error is located at:
in MapView (created by SetTintColor)
in RCTView (created by View)
in View (created by SetTintColor)
in SetTintColor
in RCTView (created by View)
in View (created by Page)
in Page
in Unknown (created by Item)
in Item (created by SceneView)
in StaticContainer
in EnsureSingleNavigator (created by SceneView)
in SceneView (created by SceneView)
in RCTView (created by View)
in View (created by DebugContainer)
in DebugContainer (created by MaybeNestedStack)
in MaybeNestedStack (created by SceneView)
in RCTView (created by View)
in View (created by SceneView)
in RNSScreen (created by Animated(Anonymous))
in Animated(Anonymous) (created by InnerScreen)
in Suspender (created by Freeze)
in Suspense (created by Freeze)
in Freeze (created by DelayedFreeze)
in DelayedFreeze (created by InnerScreen)
in InnerScreen (created by Screen)
in Screen (created by SceneView)
in SceneView (created by NativeStackViewInner)
in Suspender (created by Freeze)
in Suspense (created by Freeze)
in Freeze (created by DelayedFreeze)
in DelayedFreeze (created by ScreenStack)
in RNSScreenStack (created by ScreenStack)
in ScreenStack (created by NativeStackViewInner)
in NativeStackViewInner (created by NativeStackView)
in RNCSafeAreaProvider (created by SafeAreaProvider)
in SafeAreaProvider (created by SafeAreaProviderCompat)
in SafeAreaProviderCompat (created by NativeStackView)
in NativeStackView (created by NativeStackNavigator)
in PreventRemoveProvider (created by NavigationContent)
in NavigationContent
in Unknown (created by NativeStackNavigator)
in NativeStackNavigator (created by AppStackNavigator)
in AppStackNavigator (created by AppContainer)
in EnsureSingleNavigator
in BaseNavigationContainer
in ThemeProvider
in NavigationContainerInner (created by AppContainer)
in AppContainer (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 RNMapboxGLExample(RootComponent), js engine: hermes
Following the error, the app no longer renders anything.
setHandledMapChangeEvents should be fixed - See #3527
Mapbox Implementation
Mapbox
Mapbox Version
default
React Native Version
0.74.1
Platform
Android
@rnmapbox/maps
versionmain
Standalone component to reproduce
I am running the example app included in this repository, with the following modifications used to enable the new React Native architecture:
The above code sample based on
example/src/App.js
is just present to satisfy the issue validation rules in this repository. I am only running the example app.Observed behavior and steps to reproduce
yarn start
in the example directory.