React-Native Android is empty
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,
},
},
},
},
],
},
},
};
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
Tried to upgrade react-native-navigation to version 6.9.1 and the following happened:
- IOS is working well
- Android is showing the below error:
TypeError: null is not an object (evaluating 'this.nativeCommandsModule.setDefaultOptons')
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!
Thank you @jinshin1013. Reinstalled the library and linked it manually (without auto-linking) and then update Maven repository.