【IOS】React Native之HelloWorld

RN搭建开发环境
rvm 安装3.2.2

复制代码
brew install node@18
brew install watchman

# 使用nrm工具切换淘宝源
npx nrm use taobao

# 如果之后需要切换回官方源可使用
npx nrm use npm

npm install -g yarn

brew install cocoapods

npm uninstall -g react-native-cli @react-native-community/cli

 npx react-native@latest init AwesomeProject

cd AwesomeProjectcd

# 如果没有node_modules文件夹 
npm install

cd ios

pod install

因为rn生成的项目总是会报glog的错误,所以需要使用glog源代码覆盖项目Pods中的glog文件夹

glog源代码下载,用于覆盖项目中的glog

如果还会报 Command PhaseScriptExecution failed with a nonzero exit code 就勾选这个

No bundle URL present

要在根index.js目录下运行

复制代码
npm start
相关推荐
500843 小时前
React Native for OpenHarmony 实战:三方库 react-native-crypto-js 的鸿蒙化适配指南
javascript·react native·性能优化·electron·harmonyos
500844 小时前
React Native for OpenHarmony 实战:三方库 react-native-device-name 的鸿蒙化适配指南
深度学习·react native·react.js·机器学习·harmonyos
500845 小时前
React Native for OpenHarmony 实战:三方库 react-native-torch 的鸿蒙化适配指南
javascript·react native·react.js·harmonyos
500846 小时前
React Native for OpenHarmony 实战:三方库 react-native-device-uptime 的鸿蒙化适配指南
javascript·分布式·react native·react.js·harmonyos
是你的小橘呀19 小时前
React Native 3:useEffect 自动请求接口 + 搜索功能 + 封装 Loading 组件
react native
是你的小橘呀20 小时前
React Native 2:列表渲染 + 后端接口搭建 + Fetch 请求数据
react native
JudithHuang21 小时前
React 列表与表单
react.js
JudithHuang21 小时前
React Context 跨层传值
react.js