React-native-gesture-handler: App crash right away

Created on 6 Feb 2020  路  15Comments  路  Source: software-mansion/react-native-gesture-handler

The app is crashing right away on Android in the latest version (v1.5.5)

java.lang.IllegalStateException: View com.swmansion.gesturehandler.react.RNGestureHandlerRootView{be07dec V.E...... ......ID 0,0-1080,2022 #12f} has not been mounted under ReactRootView

$ react-native info

info Fetching system and libraries information...
System:
OS: macOS 10.15.3
CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Memory: 252.45 MB / 16.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 10.16.3 - /usr/local/bin/node
Yarn: 1.17.3 - /usr/local/bin/yarn
npm: 6.9.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
Android SDK:
API Levels: 29
Build Tools: 29.0.2
System Images: android-29 | Google APIs Intel x86 Atom_64
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.6010548
Xcode: 11.3.1/11C504 - /usr/bin/xcodebuild
npmPackages:
react: 16.12.0 => 16.12.0
react-native: 0.61.5 => 0.61.5
npmGlobalPackages:
react-native-cli: 2.0.1
react-native-rename: 2.4.1

Android

Most helpful comment

same issue here, happened after migrating to rn-0.61.5

UPD. got fixed by downgrading to 1.4.0

All 15 comments

same issue here, happened after migrating to rn-0.61.5

UPD. got fixed by downgrading to 1.4.0

same issue here, happened after migrating to rn-0.61.5

UPD. got fixed by downgrading to 1.4.0
how can i install an older version?????

yeah am also facing a similar issue, when i run my app in expo client on android, expo client crashes without any error. When i checked the logs from adb logcat , i found this exception which is causing the crash.

The relevant part was java.lang.IllegalStateException: Already prepared or hasn't been reset 02-07 19:32:39.711 3530 3530 E AndroidRuntime: at abi36_0_0.host.exp.exponent.modules.api.components.gesturehandler.GestureHandler.prepare(GestureHandler.java:7)

STACK TRACE

02-07 19:32:39.710  3530  3530 D AndroidRuntime: Shutting down VM
02-07 19:32:39.711  3530  3530 E AndroidRuntime: FATAL EXCEPTION: main
02-07 19:32:39.711  3530  3530 E AndroidRuntime: Process: host.exp.exponent, PID: 3530
02-07 19:32:39.711  3530  3530 E AndroidRuntime: java.lang.IllegalStateException: Already prepared or hasn't been reset
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at abi36_0_0.host.exp.exponent.modules.api.components.gesturehandler.GestureHandler.prepare(GestureHandler.java:7)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at abi36_0_0.host.exp.exponent.modules.api.components.gesturehandler.GestureHandlerOrchestrator.recordHandlerIfNotPresent(GestureHandlerOrchestrator.java:8)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at abi36_0_0.host.exp.exponent.modules.api.components.gesturehandler.GestureHandlerOrchestrator.recordViewHandlersForPointer(GestureHandlerOrchestrator.java:5)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at abi36_0_0.host.exp.exponent.modules.api.components.gesturehandler.GestureHandlerOrchestrator.traverseWithPointerEvents(GestureHandlerOrchestrator.java:12)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at abi36_0_0.host.exp.exponent.modules.api.components.gesturehandler.GestureHandlerOrchestrator.extractGestureHandlers(GestureHandlerOrchestrator.java:5)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at abi36_0_0.host.exp.exponent.modules.api.components.gesturehandler.GestureHandlerOrchestrator.onTouchEvent(GestureHandlerOrchestrator.java:4)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at abi36_0_0.host.exp.exponent.modules.api.components.gesturehandler.react.RNGestureHandlerRootHelper.dispatchTouchEvent(RNGestureHandlerRootHelper.java:2)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at abi36_0_0.host.exp.exponent.modules.api.components.gesturehandler.react.RNGestureHandlerRootView.dispatchTouchEvent(RNGestureHandlerRootView.java:1)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2698)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2698)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at abi36_0_0.host.exp.exponent.modules.api.components.gesturehandler.react.RNGestureHandlerEnabledRootView.dispatchTouchEvent(RNGestureHandlerEnabledRootView.java:2)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2698)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2698)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2698)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2698)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2698)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2698)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2698)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:460)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1849)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at android.app.Activity.dispatchTouchEvent(Activity.java:3974)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at b.a.o.i.dispatchTouchEvent(WindowCallbackWrapper.java:1)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:418)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at android.view.View.dispatchPointerEvent(View.java:13676)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:5479)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5282)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4785)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4838)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4804)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4944)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4812)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5001)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4785)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4838)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4804)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4812)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4785)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7502)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:7471)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7432)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:7627)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:188)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at android.os.MessageQueue.nativePollOnce(Native Method)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at android.os.MessageQueue.next(MessageQueue.java:336)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:174)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:7319)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
02-07 19:32:39.711  3530  3530 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:934)
02-07 19:32:39.794  1917  3151 W ActivityTaskManager:   Force finishing activity host.exp.exponent/.experience.ExperienceActivity
02-07 19:32:39.795  1917  4951 I DropBoxManagerService: add tag=data_app_crash isTagEnabled=true flags=0x2
02-07 19:32:39.802  1917  1949 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.stats.service.DropBoxEntryAddedReceiver
02-07 19:32:39.802  1917  1949 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.chimera.GmsIntentOperationService$PersistentTrustedReceiver

@diegommc yarn add [email protected]

try running expo start -c or npx react-native start --reset-cache

it happened to me also, android crashed after navigate to new page with createAnimatedSwitchNavigator (react-navigation)

i changed createAnimatedSwitchNavigator to createSwitchNavigator then the issue was skipped, I think it was relative with createAnimatedSwitchNavigator

It's happening on v1.6.0 too

same issue here, happened after migrating to rn-0.61.5

UPD. got fixed by downgrading to 1.4.0

This worked but, it is not a healthy way of fixing this issue

Same here, happening to me on v1.6.1

@elanpang it was the animated switch navigator for me too. I went to the regular switch animator and the problem went away. I'm on the latest version of the gesture handler and the latest 4.x of react navigation.

Affect v1.5.5 to v1.6.1. with rn-0.62.2 and React-Navigation v4.
v1.5.4 cannot be bundled in metro.

Got the same issue using v1.6.1 React-navigation v4 and react native 0.63

I just had this issue with react-navigation v4.4.0, react-native v0.63.2 and react-native-gesture-handler v1.70.

Adding [email protected] fixed the issue.

Can somebody provide reproducible repro for this one? It was mentioned that it happens after the upgrade of RNGH/navigation so it strongly suggests this is related to local npm/Gradle cache.

I'm going to close this one until repro is given as this isn't really actionable by us.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wcandillon picture wcandillon  路  4Comments

rt2zz picture rt2zz  路  4Comments

tallen11 picture tallen11  路  3Comments

brunolemos picture brunolemos  路  3Comments

muhaimincs picture muhaimincs  路  3Comments