react-native-navigation icon indicating copy to clipboard operation
react-native-navigation copied to clipboard

React-Native Android is empty

Open fadinasr opened this issue 6 years ago • 3 comments

Android App shows empty screen

React-Native Android app runs well with no issues but shows an empty activity (screen) and the log shows no errors or issues.

Steps to Reproduce / Code Snippets / Screenshots

Registering App Lauch Event Listener

Navigation.events().registerAppLaunchedListener(async () => {
  if (Platform.Version > 25) {
    await Navigation.setDefaultOptions({
      bottomTab: {
        fontSize: 12,
        selectedFontSize: 12,
      },
      topBar: {
        // hideOnScroll: true,
        drawBehind: true,
        backButton: {
          color: 'red',
        },
      },
    });
  }
  await Navigation.dismissAllModals();
  await Navigation.setRoot({
    root: {
      component: {
        name: 'App',
      },
    },
  });
});

registerComponents();
registerScreens();

Registering Screens

export function registerScreens() {
  Navigation.registerComponent('Home', () => Screens.Home);
}

Login Root

const LoginRoot = {
  root: {
    stack: {
      id: 'Login',
      children: [
        {
          component: {
            name: 'SignIn',
            options: {
              topBar: {
                visible: false,
              },
            },
          },
        },
      ],
    },
  },
};
Screen Shot 2020-07-22 at 5 27 02 PM

Environment

  • React Native Navigation version: 6.8.0
  • React Native version: 0.62.2
  • Platform(s) (iOS, Android, or both?): Android
  • Device info (Simulator/Device? OS version? Debug/Release?): All Android Devices

fadinasr avatar Jul 22 '20 14:07 fadinasr

Tried to upgrade react-native-navigation to version 6.9.1 and the following happened:

  1. IOS is working well
  2. Android is showing the below error: TypeError: null is not an object (evaluating 'this.nativeCommandsModule.setDefaultOptons')

fadinasr avatar Jul 22 '20 17:07 fadinasr

Hi @fadinasr the error seems to suggest that the react-native-navigation has not been linked correctly in your project. Could you please follow the installation guide to see if your project is set up correctly? If the issue persists, feel free to comment with the minimal reproduction on Github for us to have a more detailed look 🙂 . Cheers!

jinshin1013 avatar Jul 23 '20 09:07 jinshin1013

Thank you @jinshin1013. Reinstalled the library and linked it manually (without auto-linking) and then update Maven repository.

fadinasr avatar Jul 23 '20 09:07 fadinasr