Closed kristfal closed 4 years ago
I get this error every time, when starting the example application in my emulator when running the example from master branch.
@frankrowe any comment on this?
I am still getting the crash on Android
Exception java.lang.IndexOutOfBoundsException: Index: 1, Size: 0 at java.util.ArrayList.add (ArrayList.java:483) at com.mapbox.rctmgl.components.mapview.RCTMGLMapView.addFeature (RCTMGLMapView.kt:273) at com.mapbox.rctmgl.components.mapview.RCTMGLMapViewManager.addView (RCTMGLMapViewManager.kt:50) at com.mapbox.rctmgl.components.mapview.RCTMGLMapViewManager.addView (RCTMGLMapViewManager.kt:26) at com.facebook.react.uimanager.NativeViewHierarchyManager.manageChildren (NativeViewHierarchyManager.java:533) at com.swmansion.reanimated.layoutReanimation.ReanimatedNativeHierarchyManager.manageChildren (ReanimatedNativeHierarchyManager.java:306) at com.facebook.react.uimanager.UIViewOperationQueue$ManageChildrenOperation.execute (UIViewOperationQueue.java:217) at com.facebook.react.uimanager.UIViewOperationQueue$1.run (UIViewOperationQueue.java:915) at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches (UIViewOperationQueue.java:1026) at com.facebook.react.uimanager.UIViewOperationQueue.access$2600 (UIViewOperationQueue.java:47) at com.facebook.react.uimanager.UIViewOperationQueue$2.runGuarded (UIViewOperationQueue.java:984) at com.facebook.react.bridge.GuardedRunnable.run (GuardedRunnable.java:31) at android.os.Handler.handleCallback (Handler.java:938) at android.os.Handler.dispatchMessage (Handler.java:99) at android.os.Looper.loopOnce (Looper.java:241) at android.os.Looper.loop (Looper.java:342) at android.app.ActivityThread.main (ActivityThread.java:8117) at java.lang.reflect.Method.invoke at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:583) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1045)
Describe the bug After upgrading from 7.0.4 to 7.0.5, we started to see a significant (about 5%) crash amongst our users.
Stack trace:
Likely caused by:
https://github.com/react-native-mapbox-gl/maps/commit/3ef504d20c2fc2e69d9a84260af93b0eb915bcd6#diff-83bd90811e16ee14c9357ca5dd70f50cR395
My best guess is that since we defer adding queued features to
OnStyleLoaded
, indexes are not correct when new layers are added in the time betweenonMapReady
andOnStyleLoaded
, which in turn is causing crashes.@frankrowe this was your PR. Do you think this sounds reasonable? What was the reason for moving
addQueuedFeatures
inOnStyleLoaded
? What do you think about moving it back toonMapReady
?To Reproduce Hard to do due to the nature of the bug
Versions (please complete the following information):