react-native 创建新项目后 react-native run-ios 报错

514 阅读1分钟

After reading reactnative.dev/docs/enviro…, I created a react-natie project using npx react-native init ***.

It was successful, so, I tried to run the project using npx react-native run-ios, and got the below error:

** 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)
It's because of use_flipper in Podfile for iOS project.

So, I was needed to indicate Flipper-Folly version with use_flipper as

1.ios/ Podfile 中替换

use_flipper!({ 'Flipper-Folly' => '2.3.0' })

2.cd ios

3.pod install

4.pod update

5.cd .. && npx react-native run-ios (to run the application)