Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'RNGestureHandlerModule' could not be found. #3030

Closed
Anusha-mathur opened this issue Aug 6, 2024 · 20 comments
Closed

'RNGestureHandlerModule' could not be found. #3030

Anusha-mathur opened this issue Aug 6, 2024 · 20 comments
Labels
Missing repro Platform: Android This issue is specific to Android

Comments

@Anusha-mathur
Copy link

Anusha-mathur commented Aug 6, 2024

Description

Bridgeless mode is enabled
(NOBRIDGE) ERROR Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNGestureHandlerModule' could not be found. Verify that a module by this name is registered in the native binary.Bridgeless mode: true. TurboModule interop: true. Modules loaded: {"NativeModules":[],"TurboModules":["PlatformConstants","LogBox","SourceCode","AppState","BlobModule","WebSocketModule","DevSettings","DevToolsSettingsManager","Networking","Appearance","DevLoadingView","DeviceInfo","ImageLoader","SoundManager","IntentAndroid","DeviceEventManager"],"NotFound":["NativePerformanceCxx","NativePerformanceObserverCxx","RedBox","BugReporting","HeadlessJsTaskSupport","LinkingManager","ReanimatedModule","RNGestureHandlerModule"]}
(NOBRIDGE) LOG Running "trendlyne_app" with {"rootTag":11,"initialProps":{},"fabric":true}
(NOBRIDGE) ERROR Invariant Violation: "trendlyne_app" has not been registered. This can happen if:

  • Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
  • A module failed to load due to an error and AppRegistry.registerComponent wasn't called.
react-native: 0.74.3
react-native-gesture-handler: "2.18.1",

possible duplicate of - #2847
I want to know the root cause of this issue, While debugging I found all these modules mentioned are null. What is the thing that is causing these types of issues, Checked so many issues but no one has given the root cause of these issues.

Screenshot_1722925918

Steps to reproduce

Upgraded the react native version from 0.73 -> 0.74.3
Once I tried to build the app, it crashed as soon as it started.

Snack or a link to a repository

https://snack.expo.dev/?platform=android

Gesture Handler version

2.18.1

React Native version

0.74.3

Platforms

Android

JavaScript runtime

Hermes

Workflow

React Native (without Expo)

Architecture

Fabric (New Architecture)

Build type

Debug mode

Device

Android emulator

Device model

Pixel 6

Acknowledgements

Yes

@github-actions github-actions bot added Platform: Android This issue is specific to Android Missing repro Repro provided A reproduction with a snack or repo is provided and removed Missing repro labels Aug 6, 2024
@j-piasecki j-piasecki added Missing repro and removed Repro provided A reproduction with a snack or repo is provided labels Aug 6, 2024
@m-bert
Copy link
Contributor

m-bert commented Aug 6, 2024

Closing as duplicate of #2847

@m-bert m-bert closed this as not planned Won't fix, can't repro, duplicate, stale Aug 6, 2024
@saikiran-photon
Copy link

@m-bert if you are closing this issue. then tag related to android platform should be added in #2847 or for android it should be tracked here

@m-bert
Copy link
Contributor

m-bert commented Aug 7, 2024

@saikiran-photon This issue seems to be platform-independent so it won't be tracked under 2 separate issues. I've added relevant tag in #2847.

Also, it would be great if you could provide a reproduction, it would be much easier to find root cause of this problem.

@saikiran-photon
Copy link

@m-bert I didnt see this issue recently. Earlier i noticed this issue and when hardcoding the version i got solved temporarily.

Now since yesterday the android app for me is not working at all after installing node modules newly. i'm getting different issue

@m-bert
Copy link
Contributor

m-bert commented Aug 7, 2024

i'm getting different issue

What exactly do you mean by that?

@Anusha-mathur
Copy link
Author

@m-bert For the past month I have been following the #2847 issue for resolution but nothing seemed to work on my end. I even updated the library version from 2.17.1 to 2.18.1. I just need your little guidance regarding what can be the cause of the issue, and in what circumstances this issue can occur. I will try to fix this on my end.

@m-bert
Copy link
Contributor

m-bert commented Aug 7, 2024

@Anusha-mathur Unfortunately we don't have such information 😞 At the moment we don't have much. Moreover, we couldn't reproduce this problem. Would it be possible to take a look at your project? If not, do you have any information that may help reproduce it?

@saikiran-photon
Copy link

@m-bert Im getting below issue when i run in debug mode.

node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.kt: (375, 5): Not enough information to infer type variable

If i tried assembleRelease Im getting the below issue
Screenshot 2024-08-07 at 2 42 07 PM

This kept happening from yesterday evening IST after i install node modules freshly. it is in local as well as in automated pipelines too

@m-bert
Copy link
Contributor

m-bert commented Aug 7, 2024

@saikiran-photon this looks like something else (I don't know if those 2 problems are connected or not, at first sight it seems that they are not).

Which version of Gesture Handler do you use? Line mentioned in your error message doesn't look like its actual source. Moreover, as far as I can see last change to this file was made 6 months ago.

Do you have full logs for assembleRelease case, or is it the same as the first error?

Also if it's true that those 2 issues are not connected, it would be better to open new issue and continue our discussion under the new one. Remember to prepare a reproduction that we can look at.

@saikiran-photon
Copy link

@m-bert I'm trying to investigate more on this issue. yes the file change that you are mentioning is not done recently. but with the node modules that i have 2 days back is working fine in my local. but with the fresh one its not working.

Will create a bug for separate discussion on this once im done with my analysis.

@m-bert
Copy link
Contributor

m-bert commented Aug 7, 2024

Does Gesture Handler version differ between those node_modules?

@saikiran-photon
Copy link

no. it is not differing. we are using the older version ^2.9.0 in both the cases. I tried to increase the version to 2.15.0. there i'm getting different issue like

error: Error: Unable to resolve module ./EnableExperimentalWebImplementation from /node_modules/react-native-gesture-handler/src/index.ts:

@m-bert
Copy link
Contributor

m-bert commented Aug 7, 2024

Have you reset all caches (yarn/npm)? Do you start your metro server with --reset-cache flag? In 2.15.0 file EnableExperimentalWebImplementation no longer exists and it was renamed to EnableNewWebImplementation.

Maybe problem lies in your repo structure - is that monorepo? Do you have more than 1 version of Gesture Handler installed?

@m-bert
Copy link
Contributor

m-bert commented Aug 7, 2024

Also, have you changed your code to match those changes? Since 2.10.0 you no longer have to call enableExperimentalWebImplementation - it is done by default.

@saikiran-photon
Copy link

I tried --reset-cache but it didnt work. And for the changes of code that you were specifying about i haven't changes any code i upgraded the package to 2.15.0 and then did all the installation setup. but didnt changed anything related to code.

@saikiran-photon
Copy link

I Believe the issue is not happening because of the library. so issue with the setup itself. i will check more on the local setup that i had. thank you @m-bert ....

@m-bert
Copy link
Contributor

m-bert commented Aug 8, 2024

Now I'm not sure about which issue you're talking 😅 But my guess is that both are caused by some sort of problems with setup. Let me know if you find something!

@Anusha-mathur
Copy link
Author

Anusha-mathur commented Aug 9, 2024

@m-bert
Sorry, can't share many details about the project. I can tell you the steps I took that led to this error.
I have updated the React-native version from 0.73 to 0.74.3 and when I tried to run the app I got an async storage issue, after fixing that I got this error. Is the async library connected to this library or do we need a specific version of that library by any chance?
I have cleaned node_modules, starting the app will npm start --reset-cache, I have cleared gradle cache as well.
Where I am going wrong in setup? I have removed the library and then installed it again.
I have commented out all the usage of the gesture handle library in our code but kept this one in the package.json as it is required by react-navigtaion.
I have tried all the solutions available for this issue, but somehow not been able to move forward from this.
This is what my package.json looks like.
If you can specify which file you want to check, can share a snippet of that.
Do we need to add import "react-native-gesture-handler" in index.js and App.js? I have tried to run the app by trying both the ways, but not sure.

"dependencies": {
    "@invertase/react-native-apple-authentication": "~2.0.2",
    "@react-native-async-storage/async-storage": "1.24.0",
    "@react-native-community/datetimepicker": "~8.0.0",
    "@react-native-community/netinfo": "~11.3.1",
    "@react-native-community/push-notification-ios": "~1.10.1",
    "@react-native-firebase/analytics": "20.1.0",
    "@react-native-firebase/app": "20.1.0",
    "@react-native-firebase/crashlytics": "20.1.0",
    "@react-native-firebase/in-app-messaging": "20.1.0",
    "@react-native-firebase/messaging": "20.1.0",
    "@react-native-firebase/remote-config": "20.1.0",
    "@react-native-google-signin/google-signin": "~10.0.1",
    "@react-native-masked-view/masked-view": "~0.3.0",
    "@react-navigation/drawer": "~6.7.0",
    "@react-navigation/native": "~6.1.17",
    "@react-navigation/stack": "~6.4.0",
    "@sentry/cli": "~2.18.1",
    "@sentry/react-native": "5.9.1",
    "create-react-class": "15.6.3",
    "dayjs": "^1.11.10",
    "deprecated-react-native-prop-types": "~2.2.0",
    "hermes-engine": "0.9.0",
    "lodash": "~4.17.21",
    "react": "18.2.0",
    "react-native": "^0.74.3",
    "react-native-blob-util": "0.19.9",
    "react-native-check-version": "~1.1.1",
    "react-native-device-info": "~10.6.0",
    "react-native-draggable-flatlist": "4.0.1",
    "react-native-easy-toast": "2.3.0",
    "react-native-exception-handler": "~2.10.10",
    "react-native-fbsdk": "~3.0.0",
    "react-native-gesture-handler": "2.18.1",
    "react-native-highcharts": "1.0.2",
    "react-native-iap": "12.13.2",
    "react-native-iphone-x-helper": "1.2.1",
    "react-native-keyboard-aware-scroll-view": "0.9.5",
    "react-native-linear-gradient": "2.8.2",
    "react-native-modal": "^13.0.0",
    "react-native-modal-datetime-picker": "17.1.0",
    "react-native-orientation-locker": "~1.5.0",
    "react-native-pager-view": "6.2.0",
    "react-native-pdf": "6.7.1",
    "react-native-push-notification": "8.1.1",
    "react-native-ratings": "~7.3.0",
    "react-native-raw-bottom-sheet": "2.2.0",
    "react-native-razorpay": "2.3.0",
    "react-native-reanimated": "3.13.0",
    "react-native-responsive-fontsize": "~0.5.0",
    "react-native-responsive-screen": "1.2.2",
    "react-native-restart": "0.0.22",
    "react-native-safe-area-context": "^4.8.2",
    "react-native-status-bar-height": "~2.6.0",
    "react-native-table-component": "^1.2.2",
    "react-native-vector-icons": "~9.2.0",
    "react-native-webview": "^13.10.0",
    "react-redux": "8.1.2",
    "react-select2-native": "1.2.0",
    "redux": "4.2.1",
    "redux-persist": "6.0.0",
    "save": "2.4.0",
    "string.prototype.matchall": "~4.0.5"
  },

@Anusha-mathur Unfortunately we don't have such information 😞 At the moment we don't have much. Moreover, we couldn't reproduce this problem. Would it be possible to take a look at your project? If not, do you have any information that may help reproduce it?

b

@m-bert
Copy link
Contributor

m-bert commented Aug 9, 2024

I took the liberty of editing your comment to make package.json more readable, I hope you don't mind 😅

Is the async library connected to this library or do we need a specific version of that library by any chance?

Not really. The only place where we use async storage is in our example app, so it shouldn't be a problem (you can see that it is not specified in our main package.json), but...

It is specified in your package.json:

"dependencies": {
    "@invertase/react-native-apple-authentication": "~2.0.2",
    "@react-native-async-storage/async-storage": "1.24.0",
    ...

So probably you're using it somewhere in your project.

Do we need to add import "react-native-gesture-handler" in index.js and App.js? I have tried to run the app by trying both the ways, but not sure.

Import is not required, unless you're using something from library, like GestureDetector.

Where I am going wrong in setup?

It's hard to say given that we only have RN version and package.json. I'll try to look into this file later, maybe I'll find something. In the meantime, I have one more question:

I have updated the React-native version from 0.73 to 0.74.3

So on 0.73 it worked fine? Just to be sure, is it on new architecture?

@Anusha-mathur
Copy link
Author

@m-bert
Thanks for the reply.

So on 0.73 it worked fine? Just to be sure, is it on new architecture?

Yes, It was working fine on 0.73.

Just to be sure, is it on new architecture?

Yes, new architecture + bridgeless.

So probably you're using it somewhere in your project.

Yes, we are using "@react-native-async-storage/async-storage" in our project. To confirm something I asked if gesture handler is using async or not.

One more thing, if i am not using new architecture app is working fine, no errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Missing repro Platform: Android This issue is specific to Android
Projects
None yet
Development

No branches or pull requests

4 participants