【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
相关推荐
小遁哥2 小时前
也是用上webworker了
react.js·性能优化
红橙Darren2 小时前
手写操作系统 - 编译链接与运行
android·ios·客户端
小妖6663 小时前
react-router 怎么设置 basepath 设置网站基础路径
前端·react.js·前端框架
sure2826 小时前
react native 编写一个歌词组件
前端·react native
Ratten6 小时前
Taro React 之行为验证码之文字点选
react.js
鹏多多.6 小时前
flutter-使用device_info_plus获取手机设备信息完整指南
android·前端·flutter·ios·数据分析·前端框架
GISer_Jing10 小时前
React手撕组件和Hooks总结
前端·react.js·前端框架
风景_fengjing20 小时前
React Native + Expo搭建APP项目+安卓模拟器
react native·expo
麦兜*21 小时前
【swift】SwiftUI动画卡顿全解:GeometryReader滥用检测与Canvas绘制替代方案
服务器·ios·swiftui·android studio·objective-c·ai编程·swift
布兰妮甜1 天前
CSS Houdini 与 React 19 调度器:打造极致流畅的网页体验
前端·css·react.js·houdini