RN开发遇到的坑

1 RN 启动崩溃
https://blog.youkuaiyun.com/qq_31915745/article/details/108125671
 
2、修改报红⻚
https://blog.youkuaiyun.com/weixin_43969056/article/details/104757926
3 、编译不过去提示 glog-0.3.5 有问题,
找到 / 项⽬ /node_modules/react-native/scripts/ ios-install-third-party.sh
下载⾥⾯的⽂件放在 ~/.rncache ⽬录下就⾏
4 BVLinearGradient was not found in the UIManager ? 错误
执⾏下⾯的命令 react-native link react-native-linear-gradient
5 .babelrc ⽂件改为
{
"presets": [ "module:metro-react-native-babel-preset" ]
}
6
cd node_modules/react-native/third-party/glog-0.3.5
../../scripts/ios-configure-glog.sh
7 Xcode 13 不兼容
a)、https://blog.youkuaiyun.com/cainiao1412/article/details/125080941
b)、package.json文件增加
"resolutions": {
"component-emitter": "1.3.1"
},
8. bundle 路径错误,找不到 main.jsbundle
a) iOS ⽂件夹下建⽴、 bundle ⽂件夹
      根目录下建立bundle ⽂件夹
b)、修改ios/项目名字/AppDelegate.m文件中
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
c) 、执⾏:
react-native bundle --entry-file index.ios.js --bundle-output ./bundle/
main.jsbundle --platform ios --assets-dest ./bundle --dev false

9、RN开发日期new Date类型的坑

RN开发时间类型千万不能用new Date(),一定要用moment,在android上不兼容,并且只有发布到真机上才不兼容,远程真机调试还是正常的,坑死爹了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值