react-native: [Android] Native crashes in com.facebook.react.views.progressbar (React 0.24)

We recently updated our App from React 0.23 to React 0.24

Since then native crashes started to happen which seem to originate from ProgressBarAndroid. (We track those with Fabric/Crashlytics).

They never happened with React 0.23 and our usage of ProgressBarAndroid didn’t change in the new version.

Unfortunately I was not able to reproduce the crashes yet. They also seem to happen sporadically on our clients devices. The crashes happen on Android 5.x and 6.x.

There are two different stack traces, both originating from com.facebook.react.views.progressbar. The second one seems to be related to the first one.

Fatal Exception: java.lang.NullPointerException: Null pointer exception during instruction 'invoke-static {v5}, android.animation.AnimatorSet$Node android.animation.AnimatorSet$Node.access$200(android.animation.AnimatorSet$Node) // method@722'
       at android.animation.AnimatorSet.clone(AnimatorSet.java:707)
       at android.animation.AnimatorSet.clone(AnimatorSet.java:50)
       at android.graphics.drawable.AnimatedVectorDrawable$AnimatedVectorDrawableState.<init>(AnimatedVectorDrawable.java:363)
       at android.graphics.drawable.AnimatedVectorDrawable.mutate(AnimatedVectorDrawable.java:149)
       at android.content.res.Resources.loadDrawable(Resources.java:3746)
       at android.content.res.TypedArray.getDrawable(TypedArray.java:762)
       at android.widget.ProgressBar.<init>(ProgressBar.java:355)
       at android.widget.ProgressBar.<init>(ProgressBar.java:311)
       at com.facebook.react.views.progressbar.ProgressBarShadowNode.measure(ProgressBarShadowNode.java:57)
       at com.facebook.csslayout.CSSNode.measure(CSSNode.java:137)
       at com.facebook.csslayout.LayoutEngine.layoutNodeImpl(LayoutEngine.java:294)
       at com.facebook.csslayout.LayoutEngine.layoutNode(LayoutEngine.java:214)
       ... more layout engine stuff

and

Fatal Exception: com.facebook.react.bridge.JSApplicationIllegalArgumentException: Error while updating property 'styleAttr' of a view managed by: AndroidProgressBar
       at com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateViewProp(ViewManagersPropertyCache.java:88)
       at com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackViewManagerSetter.setProperty(ViewManagerPropertyUpdater.java:123)
       at com.facebook.react.uimanager.ViewManagerPropertyUpdater.updateProps(ViewManagerPropertyUpdater.java:42)
       at com.facebook.react.uimanager.ViewManager.updateProperties(ViewManager.java:34)
       at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManager.java:213)
       at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java:148)
       at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.dispatchPendingNonBatchedOperations(UIViewOperationQueue.java:829)
       at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:797)
       at com.facebook.react.uimanager.GuardedChoreographerFrameCallback.doFrame(GuardedChoreographerFrameCallback.java:32)
       at com.facebook.react.uimanager.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:125)
       at android.view.Choreographer$CallbackRecord.run(Choreographer.java:775)
       at android.view.Choreographer.doCallbacks(Choreographer.java:590)
       at android.view.Choreographer.doFrame(Choreographer.java:559)
       at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:763)
       at android.os.Handler.handleCallback(Handler.java:739)
       at android.os.Handler.dispatchMessage(Handler.java:95)
       at android.os.Looper.loop(Looper.java:145)
       at android.app.ActivityThread.main(ActivityThread.java:6837)
       at java.lang.reflect.Method.invoke(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:372)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
Caused by java.lang.reflect.InvocationTargetException
       at java.lang.reflect.Method.invoke(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:372)
       at com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateViewProp(ViewManagersPropertyCache.java:77)
       at com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackViewManagerSetter.setProperty(ViewManagerPropertyUpdater.java:123)
       at com.facebook.react.uimanager.ViewManagerPropertyUpdater.updateProps(ViewManagerPropertyUpdater.java:42)
       at com.facebook.react.uimanager.ViewManager.updateProperties(ViewManager.java:34)
       at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManager.java:213)
       at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java:148)
       at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.dispatchPendingNonBatchedOperations(UIViewOperationQueue.java:829)
       at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:797)
       at com.facebook.react.uimanager.GuardedChoreographerFrameCallback.doFrame(GuardedChoreographerFrameCallback.java:32)
       at com.facebook.react.uimanager.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:125)
       at android.view.Choreographer$CallbackRecord.run(Choreographer.java:775)
       at android.view.Choreographer.doCallbacks(Choreographer.java:590)
       at android.view.Choreographer.doFrame(Choreographer.java:559)
       at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:763)
       at android.os.Handler.handleCallback(Handler.java:739)
       at android.os.Handler.dispatchMessage(Handler.java:95)
       at android.os.Looper.loop(Looper.java:145)
       at android.app.ActivityThread.main(ActivityThread.java:6837)
       at java.lang.reflect.Method.invoke(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:372)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
Caused by java.lang.NullPointerException: Null pointer exception during instruction 'invoke-static {v5}, android.animation.AnimatorSet$Node android.animation.AnimatorSet$Node.access$200(android.animation.AnimatorSet$Node) // method@722'
       at android.animation.AnimatorSet.clone(AnimatorSet.java:707)
       at android.animation.AnimatorSet.clone(AnimatorSet.java:50)
       at android.graphics.drawable.AnimatedVectorDrawable$AnimatedVectorDrawableState.<init>(AnimatedVectorDrawable.java:363)
       at android.graphics.drawable.AnimatedVectorDrawable.mutate(AnimatedVectorDrawable.java:149)
       at android.content.res.Resources.loadDrawable(Resources.java:3746)
       at android.content.res.TypedArray.getDrawable(TypedArray.java:762)
       at android.widget.ProgressBar.<init>(ProgressBar.java:355)
       at android.widget.ProgressBar.<init>(ProgressBar.java:311)
       at com.facebook.react.views.progressbar.ProgressBarContainerView.setStyle(ProgressBarContainerView.java:34)
       at com.facebook.react.views.progressbar.ReactProgressBarViewManager.setStyle(ReactProgressBarViewManager.java:48)
       at java.lang.reflect.Method.invoke(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:372)
       at com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateViewProp(ViewManagersPropertyCache.java:77)
       at com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackViewManagerSetter.setProperty(ViewManagerPropertyUpdater.java:123)
       at com.facebook.react.uimanager.ViewManagerPropertyUpdater.updateProps(ViewManagerPropertyUpdater.java:42)
       at com.facebook.react.uimanager.ViewManager.updateProperties(ViewManager.java:34)
       at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManager.java:213)
       at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java:148)
       at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.dispatchPendingNonBatchedOperations(UIViewOperationQueue.java:829)
       at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:797)
       at com.facebook.react.uimanager.GuardedChoreographerFrameCallback.doFrame(GuardedChoreographerFrameCallback.java:32)
       at com.facebook.react.uimanager.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:125)
       at android.view.Choreographer$CallbackRecord.run(Choreographer.java:775)
       at android.view.Choreographer.doCallbacks(Choreographer.java:590)
       at android.view.Choreographer.doFrame(Choreographer.java:559)
       at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:763)
       at android.os.Handler.handleCallback(Handler.java:739)
       at android.os.Handler.dispatchMessage(Handler.java:95)
       at android.os.Looper.loop(Looper.java:145)
       at android.app.ActivityThread.main(ActivityThread.java:6837)
       at java.lang.reflect.Method.invoke(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:372)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 16 (4 by maintainers)

Most upvoted comments

Spoke with @astreet about it and we believe that there was a race issue in constructing ProgressBars on the shadow thread and the ui thread. @astreet put in a fix (b9396cd74419dd4165fb051605076d19b1c18905) to synchronize creation. That didn’t make it in to 24 apparently, but is in 25. Can you upgrade and try that?

Most of our users have upgraded to the new version of our app now.

So far no crashes, so I can confirm that the bug is very likely fixed in React 0.25.