maps icon indicating copy to clipboard operation
maps copied to clipboard

Thread MapboxRenderThread was not started, ignoring event

Open TIEverton opened this issue 3 years ago • 6 comments

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

TIEverton avatar Jun 22 '22 11:06 TIEverton

Having the same problem here.

portugaAndre avatar Jun 22 '22 12:06 portugaAndre

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

JoostSFS avatar Jun 27 '22 13:06 JoostSFS

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.

JoostSFS avatar Jun 28 '22 07:06 JoostSFS

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.

portugaAndre avatar Jun 28 '22 11:06 portugaAndre

Same here. Temporary workaround: Add detachInactiveScreens={false} to relevant navigators:

  <Tab.Navigator
    initialRouteName='map'
    tabBar={(props) => <TabBar {...props} />}
    detachInactiveScreens={false}
  >

AtlantisPleb avatar Jul 01 '22 16:07 AtlantisPleb

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.

portugaAndre avatar Aug 04 '22 16:08 portugaAndre

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.

creitmeier701x avatar Aug 12 '22 15:08 creitmeier701x

Duplicate of #2212

mfazekas avatar Sep 16 '22 08:09 mfazekas