Thread MapboxRenderThread was not started, ignoring event
Describe the bug
The bug occurs when I navigate from the map screen to another screen and back to the map screen, after that the App crashes, I'm using react-navigation. The only error I was able to catch using Flipper was this: [maps-android\Mbgl-MapboxRenderThread]: Thread MapboxRenderThread was not started, ignoring event
To Reproduce
I have no idea how to reproduce this
Screenshots
If applicable, add screenshots to help explain your problem.
Versions (please complete the following information):
- Platform: Android
- Platform OS: Android 7.1.1
- Device:
- Emulator/ Simulator: no
- Dev OS: Win11
- @rnmapbox/maps Version: last
- Mapbox GL version: last
- React Native Version: 0.68.2
Additional context
Having the same problem here.
I have this issue as well. Only on Android and not on iOS. It might be linked to this issue from mapbox-maps-android: https://github.com/mapbox/mapbox-maps-android/issues/1455
I've tested some more cases for this bug. I am also using React Navigation (with native stack). The error seems to happen when I navigate to a screen, using "navigation.navigate" and going back to the screen with the Mapview. React Navigation does not unmount the previous screen when using this navigation method and maybe this causes the underling issue, that the lifecycle events for Mapbox are not correctly passed. I do not get the error when I am using "navigation.replace" to move from one screen to another and going back to the MapView screen with "navigation.replace" as well. As with this navigation method the initial MapView screen is removed and later mounted again. Note that this is still not the solution to get it fixed.
We forced it to load when the screen is in focus, when it goes out of focus, it removes. It is not the best solution either.
Same here. Temporary workaround: Add detachInactiveScreens={false} to relevant navigators:
<Tab.Navigator
initialRouteName='map'
tabBar={(props) => <TabBar {...props} />}
detachInactiveScreens={false}
>
Same here. Temporary workaround: Add
detachInactiveScreens={false}to relevant navigators:<Tab.Navigator initialRouteName='map' tabBar={(props) => <TabBar {...props} />} detachInactiveScreens={false} >
this works for me, but when the app "sleeps" modal doesn't work anymore.
Same here. Temporary workaround: Add
detachInactiveScreens={false}to relevant navigators:<Tab.Navigator initialRouteName='map' tabBar={(props) => <TabBar {...props} />} detachInactiveScreens={false} >
This seems to suppress the issue for me as well. For me my bottom sheet modals appears to continue working. They do exist above the tab navigator though.
Duplicate of #2212