日常RN 报错处理

日常RN 报错处理:
现象:

ios/bundle/main.jsbundle: No such file or directory

操作:用下面的命令生成 main.jsbundle

react-native bundle --entry-file index.js --platform ios --dev false --bundle-output ./ios/bundle/main.jsbundle --assets-dest ./ios/bundle

生成过程 报其他错误:

React native build error: Unexpected > token punc «:», expected punc «,» in file

原因:metro-react-native-babel-preset 版本不对了 需要更到 0.59版本
解决方式:升级版本
yarn add metro-react-native-babel-preset@0.59
再次运行 生产main.jsbundle
就可以了

运行 pod install 报错
[!] Could not automatically select an Xcode project. Specify one in your Podfile like so:

project 'path/to/Project.xcodeproj'

引用KeyboardAwareScrollView 插件 传入子元素 使用flex 未明确定义子元素高度,导致安卓总高度塌陷三分之一,ios 会自动计算高度 无该现象


版权声明:本文为qq_23329541原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。