1.# cli.init is not a function for react native
解决:
install new react-native global
npm uninstall -g react-native-cli
npm install -g react-native-cli
npm install -g react-native
2.ruby更新https://blog.csdn.net/u011215669/article/details/103532895
所需版本号https://github.com/facebook/react-native/blob/v0.71.4/.ruby-version
3.gem升级rub
https://www.jianshu.com/p/362f3641ba1e
cocoapods升级
gem uninstall cocoapods
gem install cocoapods
4.卸载本地某些冲突
npm uninstall -g react-native-cli @react-native-community/cli
5.安装yarn
npm install -g yarn
6.android有时候会编译失败,多编译几次就会成功(可能是因为墙的原因某些安装失败)
7.babel相关插件安装babel-plugin-root-import
8:yarn add @redux-devtools/extension
9.node版本使用18.16.0初始化项目,16版本不知道为啥有问题
10.启动图icon。 https://blog.csdn.net/qq_34417314/article/details/121520023
11.splashScreen 接入
12.路由框架引入(react-navigation)
13.babel根路径引入
14.新版本的rn默认使用flipper为debugger 软件(安装地址: https://fbflipper.com/)
15.flipper协同redux开发需要安装(参考: https://github.com/jk-gan/redux-flipper), @redux-devtools/extension, redux-thunk,
持久化需要redux-persist。flipper使用(https://juejin.cn/post/7064778031964880926)
16.flipper 安卓无法找到设备(需要sdk位置, 左下角setting:https://stackoverflow.com/questions/71744103/android-emulator-unable-to-connect-to-flipper)
17.react native componentwillreceiveprops has been renamed and is not recommended for use(https://juejin.cn/s/react%20native%20componentwillreceiveprops%20has%20been%20renamed%20and%20is%20not%20recommended%20for%20use)
18.真机调试问题 This operation can fail if the version of the OS on the device is incompatible with the installed version of Xcode. You may also need to restart your mac and device in order to correctly detect compatibility.(https://blog.csdn.net/u010727765/article/details/124096865;https://gitcode.net/mirrors/filsv/iphoneosdevicesupport?utm_source=csdn_github_accelerator)
19.ios 真机调试无法连接真机,需要设置IDB binary location(https://toyboy2.medium.com/debugging-react-native-with-flipper-262da7bcadc7, https://fbidb.io/docs/installation/,具体pip版本依照自己本地安装的版本为准, https://github.com/facebook/idb/issues/615),其他:python是否安装及zsh问题(https://blog.csdn.net/baidu_30506559/article/details/127386192)
20.ios打包需要卸载flipper, 测试仍需安装
module.exports = {
dependencies: {
...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),
21.fastlane版本更新
fastlane update_fastlane
蒲公英插件更新
fastlane update_plugins
初始化项目需在ios目录下init(具体参考https://www.pgyer.com/doc/view/fastlane)
fastlane init
新版本试了下 需要配置export_options 置顶对应证书
build_app(export_method: "ad-hoc",scheme: "hyw",output_directory:"./ipa", export_options: {
provisioningProfiles: {
"com.minzhu.hywapp" => "hywAdHoc",
}
})
22.ant design rn 字体不显示问题: 字体文件需要导入(参考https://github.com/ant-design/ant-design-mobile-rn/issues/194, 注意需要add files to project) android(需要将字体文件放入app/src/main/assets/fonts/)
网友评论