首页 > 解决方案 > 启动时应用程序在 android wix react-native-navigation 抽屉中崩溃,但在 iOS 上运行良好

问题描述

我正在使用 wix.App 的 react-native-navigation(v1) 将在启动时崩溃,而在 Android 上没有任何错误消息,但在 iOS 中工作正常。

Navigation.startSingleScreenApp({
    screen: {
             screen: 'Home',

                navigatorStyle:{navBarHidden:true,
                                disabledBackGesture:true,
                                hideBackButtonTitle: true,
                                navBarBackgroundColor:'#63DCAD',
                                navBarButtonColor:'#FFF',
                                navBarTextColor:'#FFF'},

    },
    drawer: {
        left: {
            screen: 'menu',
        },
        disableOpenGesture: true
    }
});

标签: androidreact-nativecrashvelowix-react-native-navigation

解决方案


主要是由于android配置而发生的。

您是否在 androidMainApplication.java文件中添加了以下内容:

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

如果您使用 andindex.js 作为入口点而不是 index.ios.js and  index.android.js (它是 React Native 0.49 以来的默认值)。

我希望它对你有帮助。


推荐阅读