index 1, size 0 Error in React-Native Android and Custom View is not working in android 10
Hi, i am having a weird issue with the mapbox. Same code is behaving differently in iOS 13.3 and Android 10.
React-Native: 0.61.3 mapbox: "@react-native-mapbox-gl/maps": "^8.0.0-rc1",
I have used <Mapboxgl.MapView> <MapboxGL.Camera>
<CustomView for searchBox>
<MapboxGL.PointAnnotation onSelected={() => {}>
..... custom view for rendering Marker icons.
</MapboxGL.PointAnnotation>
</MapboxGL.Camera> </Mapboxgl.MapView>
In iOS 13.3 the code is woring as expected, but in Android 10 the onSelected event is not getting triggered and the custom view is also not rendering.
Also, in android for
Please help me fix this issue.
🚨🚨🚨
- Please respect and fill out the issue template
- Before you report, please make sure you tested on a physical device
- For build issues: Can you reproduce it on a clean install of the example app?
- Please make sure, that code examples are formatted.
If you want others to spend time on your issue, please make sure to first spend some time on the ticket.
Not following the above will lead to the ticket being closed. Thanks for understanding.
🚨🚨🚨
Describe the bug A clear and concise description of what the bug is.
To Reproduce Steps to reproduce the behavior
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.
Versions (please complete the following information):
- Platform: [e.g. Android, iOS]
- Device: [e.g. iPhone6]
- Emulator/ Simulator: [yes/ no]
- OS: [e.g. iOS8.1]
- SDK Version [e.g. 22]
- React Native Version [e.g. 0.59]
Additional context Add any other context about the problem here.
Closing - use the template correctly
I had the same problem, where on IOS it worked perfectly and on Android not, I found that the problem came from a text that I had inside my map, it seems that there cannot be any other component besides the map inside MapView and if it does, it needs to be placed after the markers on the map, I hope I helped!
please remove view component from map view , issue fixed