在运行react-native 项目时
报错:
unable to load script from assets ‘index.android bundle‘ ,make sure your bundle is packaged correctly or youu‘re runing a packager server
我的解决方法:
- (in project directory) mkdir android/app/src/main/assets
- yarn remove babel-preset-react-native
- yarn add babel-preset-react-native@2.1.0
- react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
- react-native run-android