software-mansion / react-native-gesture-handler

Declarative API exposing platform native touch and gesture system to React Native.
https://docs.swmansion.com/react-native-gesture-handler/
MIT License
6.09k stars 978 forks source link

Exception in native call from JS: tearDown RNGestureHandlerRootHelper.kt:53 only in Android #3157

Open kzog opened 1 week ago

kzog commented 1 week ago

Description

During development each application's fast refresh or reloading app through Metro directly results in exception. Everything seems to work fine except that. Dismissing is possible and then application refreshes correctly, without any errors this one time. Each following refresh ends with the same exception. It only happens in Android, iOS refreshes without issues.

[GESTURE HANDLER] Initialize gesture handler for root view com.facebook.react.ReactRootView{1946926 V.E...... ......ID 0,0-1080,2163 #1}
[GESTURE HANDLER] Tearing down gesture handler registered for root view com.facebook.react.ReactRootView{1946926 V.E...... ........ 0,0-1080,2163}

Exception in native call
java.lang.NullPointerException
    at com.swmansion.gesturehandler.react.RNGestureHandlerRootHelper.tearDown(RNGestureHandlerRootHelper.kt:53)
    at com.swmansion.gesturehandler.react.RNGestureHandlerModule.invalidate(RNGestureHandlerModule.kt:489)
    at com.facebook.react.turbomodule.core.TurboModuleManager.onCatalystInstanceDestroy(TurboModuleManager.java:327)
    at com.facebook.react.bridge.CatalystInstanceImpl$1$1.run(CatalystInstanceImpl.java:379)
    at android.os.Handler.handleCallback(Handler.java:1000)
    at android.os.Handler.dispatchMessage(Handler.java:104)
    at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
    at android.os.Looper.loopOnce(Looper.java:242)
    at android.os.Looper.loop(Looper.java:362)
    at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228)
    at java.lang.Thread.run(Thread.java:1012)

Could not find generated setter for class com.swmansion.gesturehandler.react.RNGestureHandlerRootViewManager
Could not find generated setter for class com.swmansion.gesturehandler.react.RNGestureHandlerButtonViewManager

Steps to reproduce

  1. run Android app without Expo
  2. reload it manually or by fast refresh

Snack or a link to a repository

N/A

Gesture Handler version

2.17.1

React Native version

0.72.12

Platforms

Android

JavaScript runtime

None

Workflow

React Native (without Expo)

Architecture

Fabric (New Architecture)

Build type

Debug mode

Device

Real device

Device model

moto g54

Acknowledgements

Yes

github-actions[bot] commented 1 week ago

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

m-bert commented 1 week ago

Hi @kzog! Could you please provide a reproduction?