Skip to content
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

[Bug]: NewArch: Exception in setHandledMapChangedEvents when loading the map in RN 0.74.2 #3522

Closed
kubabutkiewicz opened this issue Jun 12, 2024 · 5 comments · Fixed by #3570
Labels
bug 🪲 Something isn't working

Comments

@kubabutkiewicz
Copy link

kubabutkiewicz commented Jun 12, 2024

Mapbox Implementation

Mapbox

Mapbox Version

default

React Native Version

0.74.2

Platform

Android

@rnmapbox/maps version

10.1.23

Standalone component to reproduce

// I couldn't reproduce it in example app
export default () => {}

Observed behavior and steps to reproduce

We are working in Expensify on upgrading RN version to 0.74.2 and we noticed the crash caused by rnmapbox. When we navigating to screen when we are displaying map we are getting this error 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" . More context and logs are here.

Expected behavior

No response

Notes / preliminary analysis

No response

Additional links and references

rnmapbox-bug.mov

No response

@mfazekas
Copy link
Contributor

Should be fixed by #3527, there might be further similar issues

@mfazekas
Copy link
Contributor

See facebook/react-native#45024
facebook/react-native#44963

As expected there other issues as well.

#3511 (comment)

Could be worked around with patch-package, see mfazekas@dbcf2b1 for example

@mfazekas mfazekas changed the title [Bug]: Exception in setHandledMapChangedEvents when loading the map in RN 0.74.2 [Bug]: NewArch: Exception in setHandledMapChangedEvents when loading the map in RN 0.74.2 Jun 19, 2024
@roryabraham
Copy link

Looks like the upstream issue may have been fixed in facebook/react-native@8a6b88e, though it doesn't look like that has been included in a release yet

@mfazekas
Copy link
Contributor

@roryabraham so it's a bit complicated. So the issue is that in RN 0.73 what was Int32 in typescript Native codespec in was generated as Double.
In RN 0.74 this was fixed so Int32 in typescript, generated Long etc on native side. But this was not 100% change and runtime was looking for Double on android side. The plan was to fix that, but because of backward compatibility it was decided to go back 0.73 where Int32 is Double. This is something I see even in RN 0.75.rc*. Not sure about 0.74.3, will check.

I guess RN 0.76 will go with Int32 -> Long.

@mfazekas
Copy link
Contributor

So it looks like codegen is fixed (aka reverted back to java Double) in RN 0.74.3 - see #3570.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants