wix / react-native-navigation

A complete native navigation solution for React Native
https://wix.github.io/react-native-navigation/
MIT License
13.04k stars 2.67k forks source link

[Android] null is not an object (evaluating this.nativeCommandsModule.setRoot) #7553

Open Ainias opened 2 years ago

Ainias commented 2 years ago

🐛 Bug Report

With the current react-native version (0.69.1), RNN is not usable, even when the new architecture is disabled. The following error pops up in android: null is not an object (evaluating this.nativeCommandsModule.setRoot)

Have you read the Contributing Guidelines on issues?

yes

To Reproduce

  1. Create a new project with react-native init <project>
  2. Execute npx rnn-link inside project
  3. I don't know if this is neccessary, but I added the missing lines rnn-link did not added inside the build.gradle-files but are added inside the manual installation instructions (maybe the installation instructions is old?)
  4. Add include ':react-native-navigation' and project(':react-native-navigation').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-navigation/lib/android/app/') to settings.properties (this was also in my main project)
  5. Add implementation project(':react-native-navigation') to the dependencies of app/build.gradle. This was also in my main project. Before this step, npm run android would not build the apk
  6. Replace content of index.js with the content of the installation instructions
  7. Run npm run android. The Error is shown.

Here is a reproducable repo. Just call npm install and npm run android and you'll get the error https://github.com/churchtools/rnn-null-is-not-an-object

Expected behavior

The app starts normal, without any error

Actual Behavior

The error is displayed.

Your Environment

Reproducible Demo

Here is a reproducable repo. Just call npm install and npm run android and you'll get the error https://github.com/churchtools/rnn-null-is-not-an-object

Are you willing to resolve this issue by submitting a Pull Request?

thebylito commented 2 years ago

see: https://github.com/churchtools/rnn-null-is-not-an-object/pull/1/commits/1d4dd24c44836eacb61c26c57338a59ad3c292d7