Skip to content

Attempt to invoke virtual method 'void com.rnmaps.maps.MapMarker.update(int, int)' on a null object reference #5605

@JuMalIO

Description

@JuMalIO

Summary

I am getting an error when filtering changing markers on Android:

Attempt to invoke virtual method 'void com.rnmaps.maps.MapMarker.update(int, int)' on a null object reference

"react": "19.1.0",
"react-native": "0.80.0",
"react-native-maps": "^1.24.3",

What's the correct way to deal with it? Should I not remove DOM elements and instead hide/set opacity to 0?
How do I get notified that Layout is happening and on that stage I should not change markers?
Any help/ideas what could be causing this?

Reproducible sample code

complex code

Steps to reproduce

Adding removing Markers when layout is going on?

Expected result

not crashing

Actual result

crashing with native error
Attempt to invoke virtual method 'void com.rnmaps.maps.MapMarker.update(int, int)' on a null object reference

React Native Maps Version

1.24.3

What platforms are you seeing the problem on?

Android

React Native Version

0.80.0

What version of Expo are you using?

Not using Expo

Device(s)

Android 14

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions