ReactNative-npxreact-nativerun-ios在初始化项目后不起作用
阅读https://reactnative.dev/docs/environment-setup 后,我使用npx react-native init ***.
它成功了,因此,我尝试使用 运行该项目npx react-native run-ios,但出现以下错误:
** BUILD FAILED **
The following build commands failed:
CompileC /Users/loser/Library/Developer/Xcode/DerivedData/test0205-dasunahpjpavelgmslwgmvjhesxy/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Flipper.build/Objects-normal/x86_64/FlipperRSocketResponder.o /Users/loser/Documents/projects/test0205/ios/Pods/Flipper/xplat/Flipper/FlipperRSocketResponder.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
回答
这是因为use_flipper在 iOS 项目的 Podfile 中。
use_flipper!
所以,我需要Flipper-Folly用 use_flipper表示版本为
use_flipper!({ 'Flipper-Folly' => '2.3.0' })
在那次更改之后,它运行得很好。
- Make sure to remove `Podfile.lock` and then run `pod install` after making this change.
回答
以下珠穆朗玛峰登山者回答
- 在 ios/ 文件夹下的 Podfile 中
改变use_flipper!to use_flipper!({ 'Flipper-Folly' => '2.3.0' })
- 光盘
- 吊舱安装
- 豆荚更新
- cd .. && npx react-native run-ios(运行应用程序)
这对我有用。希望它也适用于你
回答
在 ios/Podfile 中禁用 Flipper 后,我可以解决这个问题。
- 修复 Podfile 如下图所示
- 光盘
- 删除 Pods 文件夹和 Podfile.lock
- 吊舱安装
- 豆荚更新
- cd .. && npx react-native run-ios
- Awesome. I had the same issue and this solution worked like a charm.
回答
这似乎是 react-native 0.63 中的一个问题,尝试使用 --version 0.62 启动项目,它应该可以工作,直到他们修复错误
THE END
二维码