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

install and debug on rn 0.71.8 #7734

Closed uganof closed 1 year ago

uganof commented 1 year ago

What happened?

after installing rn 0.71.8 and adding the module with:

npm i react-native-navigation (7.34.0)

npx rnn-link

first problem:

send an error for the file MainApplication (android): Error: There was a problem extending NavigationReactNativeHost().

but it is not clear how I can solve it manually because version 0.71.8 has a different file than the previous one indicated in the documentation.

If anyone has an idea what to change, thanks

second problem that is present on both Android and Ios: it is no longer possible to debug (I use visual studio code but the same goes for chrome) the screen remains white or black

what did I miss?

What was the expected behaviour?

No response

Was it tested on latest react-native-navigation?

Help us reproduce this issue!

No response

In what environment did this happen?

React Native Navigation version: 7.34.0 React Native version: 0.71.8 Has Fabric (React Native's new rendering system) enabled: no Node version: 18.16.0

uganof commented 1 year ago

Greetings, after some tests and searches among the issues of this same site I understood 2 things that I hope will be useful:

public class MainApplication extends NavigationApplication {  // change trhis

  private final ReactNativeHost mReactNativeHost =
      new NavigationReactNativeHost(this) {
        @Override
        public boolean getUseDeveloperSupport() {
          return BuildConfig.DEBUG;
        }

        @Override
        protected List<ReactPackage> getPackages() {
          @SuppressWarnings("UnnecessaryLocalVariable")
          List<ReactPackage> packages = new PackageList(this).getPackages();
          // Packages that cannot be autolinked yet can be added manually here, for example:
          // packages.add(new MyReactNativePackage());
          return packages;
        }

        @Override
        protected String getJSMainModuleName() {
          return "index";
        }

        //@Override
        protected boolean isNewArchEnabled() {
          return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
        }

        //@Override
        protected Boolean isHermesEnabled() {
          return BuildConfig.IS_HERMES_ENABLED;
        }
      };

For debugging I use vscode and activating debugging with hermes everything works.

I hope it can be useful

LYevhen commented 1 year ago

@uganof Thanks a lot for help, looks, I had similar file but issue in my case was to remove overrides strings.

yogevbd commented 1 year ago

Fixed in react-native-navigation@7.36.0