1.Unable to resolve module 'AccessibilityInfo'
有一种可能react-native 和 react-native-cli版本问题导致
https://blog.csdn.net/aceaddi/article/details/81148585
卸载react-native-cli
npm uninstall -g react-native-cli
依次安装react-native 和 react-native-cli稳定版本
npm install react-native@0.55.4
npm install -g react-native-cli@1.2.0
新建项目
react-native init --version="0.55.4" projectname
2.unable to load script from assets 'index.android bundle' ,make sure your bundle is packaged correctly or youu're runing a packager server
在第一步新建项目基础上
cd projectname
main文件夹下新建assets文件夹,Windows下没有命令的直接手动创建
mkdir android/app/src/main/assets
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
然后可以运行react-native start,再react-native run-android
网友评论