有道是 一天不学习,我就很开心……
但身边过于优秀的同事——老王,给了我很大的压力。
我决定开始学RN……
虽然现在学时间不算早,西卡西,学不可以已矣……哎嗨哎嗨呦……
闲言少叙,开工。
0.打开说明书
1. npx react-native init native01
2. yarn ios 上面npx 这里 yarn
error Could not find "Podfile.lock" at ……native01/ios/Podfile.lock. Did you run "pod install" in iOS directory?
cd ios && pod install
ten years later
3.UnhandledPromiseRejectionWarning: Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template. Please try again manually: "cd ./native01/ios && pod install".
很明显姿势不对,再来一次。
cd ios && pod install
ten minutes late
4. 报错 ,这个命令不纯啊,两次报错竟然不一样?!
[!] /bin/bash -c
set -e #!/bin/bash
看来是需要安装xcode
嗯,走起。
5.不能将 xcode 安装在 “Macintosh HD” 上,因为需要 macOS v10.15.4 或更高版本
下载地址
不早说,我三个小时没有了。
不能安装10.2.1,三个小时
不能安装10以上,一个小时
ten years later
9.4.1下载完成
9.4.1解压
ten years later
6. 安装提示版本冲突
移除之前版本的xcode
7. Unable to boot device because it cannot be located on disk
运行 xcrun simctl erase all
8. poodfile.lock can't find ……
sudo gem install cocoapods cd ios && pod install
487s后……
9. Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65
rm -rf node_modules && yarn cache clean
rm -rf ~/.rncache
yarn install react-native run-ios
fail again……
大吉
rm -rf project
10.我就很气了,负重致远 不可急躁 不可急躁
npx react-native init project
cd project && npx react-native run-ios
11.Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening native01.xcworkspace. Run CLI with --verbose flag for more details.
老铁,你可以的呀。
well done
rm -rf project
shutdown now
告辞 不学了,谁学谁是狗。
- 汪汪汪……
升级mac big sur
- 系统下完,appstore 下xcode,四点的灯光再看一遍。
yarn ios
14.xcrun: error: active developer path ("……/Xcode.app/Contents/Developer") does not exist Use
睡了,睡了,50岁的身体,扛不住了。
15.yarn ios
`sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools, or use `xcode-select --install` to install the standalone command line developer tools. See `man xcode-select` for more details. xcode-select --install sudo xcode-select --switch /applications/Xcode.app yarn ios success Successfully launched the app on the simulator
✨ Done in 489.28s.
看到这行字,留下了泪水……
16.error: Can't find the 'node' binary to build the React Native bundle. If you……
呦吼,小伙子你可以呀。
治不了太君还……
nvm下的node需要建立软连接
ln -s $(which node) /usr/local/bin/node
17.yarn ios
success Successfully launched the app on the simulator ✨ Done in 16.50s.
嗯,这下可以吹高级RN工程师了。
RN环境有点复杂……
嗯,有亿点吧……
常见问题FAQ
- 免费下载或者VIP会员专享资源能否直接商用?
- 本站所有资源版权均属于原作者所有,这里所提供资源均只能用于参考学习用,请勿直接商用。若由于商用引起版权纠纷,一切责任均由使用者承担。更多说明请参考 VIP介绍。
- 提示下载完但解压或打开不了?
- 找不到素材资源介绍文章里的示例图片?
- 模板不会安装或需要功能定制以及二次开发?
发表评论
还没有评论,快来抢沙发吧!