maps: [Bug]: Exception in ViewTagResolver after app reloading

Mapbox Implementation

Mapbox

Mapbox Version

10.16.2

Platform

Android

@rnmapbox/maps version

#main

Standalone component to reproduce

// I could not reproduce it in the Example app 
export default () => {};

Observed behavior and steps to reproduce

The issue occurs after hot reloading or reloading via terminal in debug mode. To avoid it only helps full(force) closing the app

Expected behavior

No issues

Notes / preliminary analysis

Looks like making the manager optional and adding guards when extracting it, solves the problem

private val manager : UIManager?
        get() =
            if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
                UIManagerHelper.getUIManager(context, UIManagerType.FABRIC)
            } else {
                UIManagerHelper.getUIManager(context, UIManagerType.DEFAULT)
            }

Additional links and references

screencap-2023-12-06T073217 785Z

About this issue

  • Original URL
  • State: open
  • Created 7 months ago
  • Reactions: 2
  • Comments: 17 (14 by maintainers)

Most upvoted comments

I’m seeing this as well. First load works OK, but if you put the app into the background and then bring it back active I get an Exception in Native call from JS in ViewTagResolver.kt:51.

For info, I am NOT using new arch and I see this on both Mapbox 10 and 11.

"react-native": "^0.73.1",
"@rnmapbox/maps": "^10.1.3",
"react-native-safe-area-context": "^4.8.2",
"react-native-screens": "^3.29.0",

Screenshot 2023-12-24 at 12 25 56