react-native-gesture-handler: java.lang.IllegalStateException: Expect view tag to be set on CodePush restart

My app is running react-native 0.60.4 and react-native-gesture-handler 1.3.0. It also uses react-native-code-push 5.6.0 for OTA updates.

It checks for and installs any new updates on app launch. After installation, the app is restarted with the new version. Upon restart, my Android users are frequently hitting an exception:

IllegalStateException
Expect view tag to be set for com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView{3cdcdcc V.E...... ........ 0,0-1440,2392}
com.swmansion.gesturehandler.react.RNGestureHandlerRootHelper in <init> at line 45
com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView in initialize at line 49
com.swmansion.gesturehandler.react.RNGestureHandlerModule$2 in execute at line 603
com.facebook.react.uimanager.UIViewOperationQueue$UIBlockOperation in execute at line 530
com.facebook.react.uimanager.UIViewOperationQueue$1 in run at line 844
com.facebook.react.uimanager.UIViewOperationQueue in flushPendingBatches at line 952
com.facebook.react.uimanager.UIViewOperationQueue in access$2200 at line 44
com.facebook.react.uimanager.UIViewOperationQueue$2 in runGuarded at line 910
com.facebook.react.bridge.GuardedRunnable in run at line 24
android.os.Handler in handleCallback at line 873
android.os.Handler in dispatchMessage at line 99
android.os.Looper in loop at line 193
android.app.ActivityThread in main at line 6718
java.lang.reflect.Method in invoke
com.android.internal.os.RuntimeInit$MethodAndArgsCaller in run at line 495
com.android.internal.os.ZygoteInit in main at line 858

Any previous issues I’ve found around this exception mention issues with componentDidMount state logic inside gesture handler components. However, I don’t believe I’m doing any of that. The only component I’m using directly is Swipeable.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 18
  • Comments: 31 (1 by maintainers)

Most upvoted comments

My issue was caused by attempting to navigate to a different screen while CodePush was trying to restart. Stopping that fixed the issue for me.

Hello, I’ve the same problem here, using react native 0.60.5, I’ve this error:

Expect view tag to be set for com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView

I’m using jetifier but still having this issue…

Fatal Exception: java.lang.IllegalStateException: java.lang.IllegalStateException: Expect view tag to be set for com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView{bbcb787 V.E… … 0,0-1080,2400} at com.facebook.react.bridge.ReactContext.handleException(ReactContext.java:390) at com.facebook.react.bridge.ReactContext$ExceptionHandlerWrapper.handleException(ReactContext.java:397) at com.facebook.react.bridge.GuardedRunnable.run(GuardedRunnable.java:33) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:224) at android.app.ActivityThread.main(ActivityThread.java:7565) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)

Got this error on google console and there are many crashes due to it. Any solution?

Happening to me too, RN63.3, RNGestureHandler: “react-native-gesture-handler”: “1.6.1”, “react-native”: “0.63.3”,

@HarshitMadhav error also exists for version 0.59.5, below 0.60

We’re getting this error as a crash for prod builds.

I can confirm it’s after a CodePush sync has been fired

Any update for this, happening to me on react native 0.59.10?

same issue for react native 0.59.5 react-native-code-push 5.6.0 react-native-gesture-handler 1.1.0