ios - React Native 启动项目 IOS 构建失败

标签 ios xcode react-native build

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

当我遇到错误时,我使用的是 Xcode 8,我还将 Xcode 更新为 9.0 和 Node 等。但没有任何效果,所有错误都与我从一开始遇到的错误相同。

** 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
react native :0.49.3
npm: 5.3.0

最佳答案

您是否尝试过使用 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

关于ios - React Native 启动项目 IOS 构建失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46681128/

相关文章:

xcode - 编写 Bridge 和 Apple Mail 脚本

ios - xCode 不会从 Unity 解析项目

objective-c - 从 nsarray 中取出对象

iphone - IBAction、IBOutlet 等中的 IB 是什么意思?

ios - 如何解析 "Initializer for conditional binding must have Optional type, not ' Int'”?

javascript - RefreshControl with ScrollView 每次刷新都会向下移动屏幕内容

javascript - 在react-native中加载动态资源

react-native - 在 native react 中显示 Base64 svg

objective-c - 如何通过错误代码识别 UIWebView 错误?

ios - 应用程序启动后检查 iOS 应用程序互联网连接