- Notifications
You must be signed in to change notification settings - Fork 103
Description
This nullPointerException only occurs when Instabug is integrated into my app. If I remove Instabug this issue goes away. This appears to be a thread safety issue where something is accessing react-natives ui operations queue from a thread other than the UI thread. There's more information in these issues:
facebook/react-native#11428
facebook/react-native#27819
This is a very severe issue for us. It crashes ~10% of all sessions which means we cannot use Instabug while this issue is ongoing. We tried a lot of things to track this one down and found out it was Instabug by trial and error.
This only happens in our release build on the play store. We have not been able to reproduce it on demand but it happens for > 10% of all user sessions.
Fatal Exception: java.lang.NullPointerException Attempt to invoke interface method 'void com.facebook.react.uimanager.UIViewOperationQueue$UIOperation.execute()' on a null object reference com.facebook.react.uimanager.UIViewOperationQueue$1.run (UIViewOperationQueue.java:917) com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches (UIViewOperationQueue.java:1028) com.facebook.react.uimanager.UIViewOperationQueue.access$2600 (UIViewOperationQueue.java:48) com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded (UIViewOperationQueue.java:1088) com.facebook.react.uimanager.GuardedFrameCallback.doFrame (GuardedFrameCallback.java:29) com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame (ReactChoreographer.java:175) com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame (ChoreographerCompat.java:85) android.view.Choreographer$CallbackRecord.run (Choreographer.java:1055) android.view.Choreographer.doCallbacks (Choreographer.java:875) android.view.Choreographer.doFrame (Choreographer.java:772) android.view.Choreographer$FrameDisplayEventReceiver.run (Choreographer.java:1042) android.os.Handler.handleCallback (Handler.java:900) android.os.Handler.dispatchMessage (Handler.java:103) android.os.Looper.loop (Looper.java:219) android.app.ActivityThread.main (ActivityThread.java:8347) java.lang.reflect.Method.invoke (Method.java) com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:513) com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1055) Steps to Reproduce the Problem
Run a release build of a RN 0.63.2 app with Instabug on Android
Expected Behavior
App should not crash
Actual Behavior
App crashes randomly with the above exception for >10% of sessions. If we remove Instabug our app is 100% crash free.
Instabug integration code
package.json
"instabug-reactnative": "^9.1.7",
MainApplication.java
import com.instabug.reactlibrary.RNInstabugReactnativePackage; ..... @Override public void onCreate() { ..... new RNInstabugReactnativePackage.Builder("MY_TOKEN", MainApplication.this) .setInvocationEvent("shake") .setInvocationEvent("button").setPrimaryColor("#1D82DC").setFloatingEdge("right") .setFloatingButtonOffsetFromTop(500) .build(); super.onCreate(); ..... } App js code
Instabug.startWithToken("MY_TOKEN", [Instabug.invocationEvent.shake]) if (Platform.OS == "ios") { //only call this on ios, on android it results in two buttons let instabug_button_position = 0.55 * height Instabug.setFloatingButtonEdge(Instabug.floatingButtonEdge.right, instabug_button_position) } BugReporting.setAutoScreenRecordingEnabled(false) SDK Version
9.1.7 react native
React Native, iOS and Android Versions
RN 0.63.2
Device Model
Any Android device
[Optional] Project That Reproduces the Issue
Unable to reproduce on demand. Only happens in release build on play store where it appears to happen at random.