Repository navigation
Description
Before submitting a new issue
- I tested using the latest version of the library, as the bug might be already fixed.
- I tested using a supported version of react native.
- I checked for possible duplicate issues, with possible answers.
Bug summary
App crashes on Android when a custom React Native view is rendered as a child of Marker.
The crash occurs due to an IllegalArgumentException: parameter must be a descendant of this view thrown from Android's accessibility/content capture system (ViewGroup.offsetRectBetweenParentAndChild). This happens because the native marker view detaches or re-parents the child view during rendering, leaving a stale reference in the Android view hierarchy.
The crash does NOT occur when Marker has no children (default pin). It only happens when passing a custom child view.
Workarounds attempted (none resolved the issue):
- Wrapping child in
<View importantForAccessibility="no-hide-descendants"> - Wrapping child in
<View collapsable={false}> - Both combined
Stack trace:
java.lang.IllegalArgumentException: parameter must be a descendant of this view
android.view.ViewGroup.offsetRectBetweenParentAndChild(ViewGroup.java:6467)
android.view.ViewGroup.offsetDescendantRectToMyCoords(ViewGroup.java:6396)
android.view.ViewGroup$ViewLocationHolder.init(ViewGroup.java:9509)
...
com.facebook.react.views.view.ReactViewGroup.addChildrenForAccessibility(ReactViewGroup.kt:1047)
android.view.ViewGroup.onInitializeAccessibilityNodeInfoInternal(ViewGroup.java:3940)
Library version
1.0.0-beta.8
Environment info
System:
OS: macOS 26.3.1
CPU: (10) arm64 Apple M1 Max
Memory: 166.72 MB / 32.00 GB
Shell: 5.9 /bin/zsh
Binaries:
Node: 24.14.0
npm: 11.9.0
Watchman: 2025.08.18.00
Managers:
CocoaPods: 1.16.2
SDKs:
iOS SDK: iOS 26.2
Xcode: 26.3 / 17C529
npmPackages:
react: 19.2.0
react-native: 0.83.2
iOS:
hermesEnabled: true
newArchEnabled: trueSteps to reproduce
- Render a
MapViewwith one or moreMarkercomponents - Pass any custom React Native view as a child of
Marker(e.g. an SVG icon or an)
- Run on Android (physical device or emulator)
- The app crashes immediately on render with IllegalArgumentException
import { MapView, Marker } from "@lugg/maps";
import { View, Text } from "react-native";
export default function App() {
return (
<MapView
style={{ flex: 1 }}
initialCoordinate={{ latitude: 41.387, longitude: 2.1701 }}
>
<Marker coordinate={{ latitude: 41.387, longitude: 2.1701 }}>
{/* Any custom child causes the crash on Android */}
<View style={{ width: 22, height: 28, backgroundColor: "red" }} />
</Marker>
</MapView>
);
}
Reproducible example repository
https://github.com/dacoto/transportam-app/tree/next
Activity
techfoundrynz commentedon Mar 27, 2026
@lugg__maps@1.0.0-beta.5.patch
I also have the same issue but wrote a patch to work around it in LuggMarkerView. It's a bit of a hack but is working for me for now.
dacoto commentedon Apr 2, 2026
Hi @lodev09, do you think you could help me solve this error that prevents me from using markers with an icon on Android?
I've created a pull request with a proposed solution, but you might have a better solution that unlocks the use of your library in Android.
lodev09 commentedon Apr 2, 2026
This upstream RN PR should fix this issue:
react/react-native#56182 (comment)
techfoundrynz commentedon Apr 3, 2026
Just tested with this change as a patch and while it no longer crashes, I don't see custom map markers on Android at all now.
techfoundrynz commentedon Apr 3, 2026
Okay, figured my issue out and made another patch to get my markers working (I'm using renanimated)
@lugg__maps.patch
lodev09 commentedon Apr 3, 2026
@techfoundrynz feel free to create PR. Thanks!
lodev09 commentedon Apr 3, 2026
#68 should fix this properly