简体   繁体   中英

new react-native (0.70.1 ) init can't build iOS project

I made a new project with react-native init then ran into terminal yarn iOS and I got a build error:

** BUILD FAILED **

The following build commands failed: CompileC /Users/Mac/Library/Developer/Xcode/DerivedData/app-aoijdzoxvbwwndbylmokvtqowgiu/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-Codegen.build/Objects-normal/x86_64/FBReactNativeSpec-generated.o /Users/Mac/doc/code1/app/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec-generated.mm normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (1 failure)

Ensure that you have firstly installed all the necessary dependencies like homebrew and watchman. Also ensuer you have a ruby installed by running the command

ruby --version

If all is properly installed, you might try installing a specific version of react native

 npx react-native init MyProjectName --version 0.69

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM