[Android] Native crashes in com.facebook.react.views.progressbar (React 0.24)
See original GitHub issueWe 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)
Issue Analytics
- State:
- Created 7 years ago
- Comments:16 (4 by maintainers)
Top Results From Across the Web
React-Native: Run time crash --> Didn't find class "com ...
React -Native app crash is happening while app is in run time. Here is the log from Android Studio, 2022-11-09 10:55:50.497 ...
Read more >my react app shows and disappearvwhen theblocal host is filly ...
Restart app on emulator once again to view updated code. App crashes and fails to launch. Logcat shows com.facebook.react.common.
Read more >react-native/CHANGELOG.md - UNPKG
This version of Android Gradle plugin enforces JDK 11 for Android builds. Do not upgrade to AGP 7.1 as it is not supported...
Read more >@react-native-community/progress-bar-android - npm
Start using @react-native-community/progress-bar-android in your project by running ... import React from 'react'; import {View, StyleSheet, ...
Read more >Gadgetbridge/CHANGELOG.md at master - Codeberg
Fix accepting/rejecting calls on Android 9; Mi Band 3/4, ... Mi Band 1/2: Crash when updating firmware while phone is set to Spanish...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.