React Native获取启动项目IOS构建失败

时间:2017-10-11 06:23:13

标签: ios xcode react-native build

我在创建第一个React Native项目( AwesomeProject )时遇到以下错误。我在Android上运行了这个项目,它按预期工作。请查找附加的快照并指导IOS出了什么问题。

我在使用Xcode 8时遇到错误我还将我的Xcode更新为9.0和节点等..但没有任何工作,所有错误都与我从开始以来获得的相同。

** BUILD FAILED **

The following build commands failed:
        CompileC /Users/clines291/RNProjects/AwesomeProject/ios/build/Build/Intermediates.noindex/React.build/Debug-iphonesimulator/third-party.build/Objects-normal/x86_64/Conv.o/Users/clines291/RNProjects/AwesomeProject/node_modules/react-native/third-party/folly-2016.09.26.00/folly/Conv.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
        CompileC /Users/clines291/RNProjects/AwesomeProject/ios/build/Build/Intermediates.noindex/React.build/Debug-iphonesimulator/third-party.build/Objects-normal/x86_64/StringBase.o /Users/clines291/RNProjects/AwesomeProject/node_modules/react-native/third-party/folly-2016.09.26.00/folly/StringBase.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)

Installing build/Build/Products/Debug-iphonesimulator/AwesomeProject.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
Print: Entry, ":CFBundleIdentifier", Does Not Exist

Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-    iphonesimulator/AwesomeProject.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

附件:
Visual Code build failed error
Xcode build failed errors

版本:
Xcode:9.0
节点:v8.6.0
自制:1.3.5
守望者:4.9.0
react-native-cli:2.0.1
本土反应:0.49.3
npm:5.3.0

3 个答案:

答案 0 :(得分:1)

你尝试过使用xcode 8而不是xcode 9吗?

或者如果您仍想使用xcode 9 试试这个

rm -r ~/.rncache/
cd node_modules/react-native/third-party/glog-0.3.4/
./configure --host arm-apple-darwin

答案 1 :(得分:0)


我在下面提到的链接上找到了这个解决方案:
https://github.com/facebook/react-native/issues/14368
react-native init [PROJECT_NAME] --version 0.44.0

答案 2 :(得分:0)

这是C编译器问题 enter image description here

打开xcode,选择“构建设置”>“构建选项”, 然后启用c编译器就可以了。