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
所需版本號(hào)https://github.com/facebook/react-native/blob/v0.71.4/.ruby-version
3.gem升級(jí)rub
http://www.reibang.com/p/362f3641ba1e
cocoapods升級(jí)
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有時(shí)候會(huì)編譯失敗侧蘸,多編譯幾次就會(huì)成功(可能是因?yàn)閴Φ脑蚰承┌惭b失敳妹小)
7.babel相關(guān)插件安裝babel-plugin-root-import
8:yarn add @redux-devtools/extension
9.node版本使用18.16.0初始化項(xiàng)目,16版本不知道為啥有問(wèn)題
10.啟動(dòng)圖icon闺魏。 https://blog.csdn.net/qq_34417314/article/details/121520023
11.splashScreen 接入
12.路由框架引入(react-navigation)
13.babel根路徑引入
14.新版本的rn默認(rèn)使用flipper為debugger 軟件(安裝地址: https://fbflipper.com/)
15.flipper協(xié)同redux開(kāi)發(fā)需要安裝(參考: https://github.com/jk-gan/redux-flipper), @redux-devtools/extension, redux-thunk,
持久化需要redux-persist。flipper使用(https://juejin.cn/post/7064778031964880926)
16.flipper 安卓無(wú)法找到設(shè)備(需要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.真機(jī)調(diào)試問(wèn)題 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 真機(jī)調(diào)試無(wú)法連接真機(jī),需要設(shè)置IDB binary location(https://toyboy2.medium.com/debugging-react-native-with-flipper-262da7bcadc7, https://fbidb.io/docs/installation/艰垂,具體pip版本依照自己本地安裝的版本為準(zhǔn)泡仗, https://github.com/facebook/idb/issues/615),其他:python是否安裝及zsh問(wèn)題(https://blog.csdn.net/baidu_30506559/article/details/127386192)
20.ios打包需要卸載flipper猜憎, 測(cè)試仍需安裝
module.exports = {
dependencies: {
...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),
21.fastlane版本更新
fastlane update_fastlane
蒲公英插件更新
fastlane update_plugins
初始化項(xiàng)目需在ios目錄下init(具體參考https://www.pgyer.com/doc/view/fastlane)
fastlane init
新版本試了下 需要配置export_options 置頂對(duì)應(yīng)證書
build_app(export_method: "ad-hoc",scheme: "hyw",output_directory:"./ipa", export_options: {
provisioningProfiles: {
"com.minzhu.hywapp" => "hywAdHoc",
}
})
22.ant design rn 字體不顯示問(wèn)題: 字體文件需要導(dǎo)入(參考https://github.com/ant-design/ant-design-mobile-rn/issues/194, 注意需要add files to project) android(需要將字體文件放入app/src/main/assets/fonts/)
23.sh: Permission denied(test.sh 用自己的文件路徑代替)
chmod 777 test.sh
24.pod安裝過(guò)程 xcrun: error: SDK “iphoneos“ cannot be located
sudo xcode-select --switch /Applications/Xcode.app
再pod install
- Watchman crawl failed. Retrying once with node crawler.
Usually this happens when watchman isn't running. Create an empty.watchmanconfig
file in your project's root folder or initialize a git or hg repository in your project.
解決方案:
watchman watch-del-all
watchman shutdown-server