繁体   English   中英

新的react-native项目无法运行ios:以下构建命令失败:CompileC

[英]New react-native project can't run-ios: The following build commands failed: CompileC

我只是想启动一个新的本机应用程序,但没有运气。

react-native初始化NewApp cd NewApp npm install react-native run-ios

然后看到以下错误:

** BUILD FAILED **

The following build commands failed:
    CompileC /Users/arc/Desktop/websites-dev/react-native/testing_rn/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/React.build/Objects-normal/x86_64/RCTProfile.o Profiler/RCTProfile.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler

(1 failure)

Installing build/Build/Products/Debug-iphonesimulator/testing_rn.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/testing_rn.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

使用:

npm 4.1.2
node v7.5.0
El Capitan 10.11.6
Xcode 8.2

的package.json:

{
    "name": "testing_rn",
    "version": "0.0.1",
    "private": true,
    "scripts": {
        "start": "node node_modules/react-native/local-cli/cli.js start",
        "test": "jest"
    },
    "dependencies": {
        "react": "15.4.2",
        "react-native": "0.42.3"
    },
    "devDependencies": {
        "babel-jest": "19.0.0",
        "babel-preset-react-native": "1.9.1",
        "jest": "19.0.2",
        "react-test-renderer": "15.4.2"
    },
    "jest": {
        "preset": "react-native"
    }
}

看来这可能与通过终端进行的构建有关,但应用程序仍可以在xcode中运行?

来自25天前的github问题:

一些相关的问题:

================================================== =======

更新:

对我而言,这似乎与0.42.0及更高版本有关。 我可以运行安装的0.41.2项目

react-native init --version 0.41.2 example412
cd example412
npm install
react-native run-ios

和繁荣。 有用。 但这会出现错误:

react-native init example_latest
cd example_latest
npm install
react-native run-ios

然后上述错误又回来了。 初始化版本为0.42.0时出现相同的错误:

react-native init --version 0.42.0 example420
cd example420
npm install
react-native run-ios

对我来说,我想我需要更新xcode。 我以为我是8.3,但显然不是。 在更新我的xcode之前,我还需要将osx更新到10.12.4。 现在我一切都很好,并在0.42.3上运行一个react-native初始化应用程序

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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