【问题标题】:New react-native project can't run-ios: The following build commands failed: CompileC新的 react-native 项目无法运行-ios:以下构建命令失败:CompileC
【发布时间】:2017-03-30 14:18:26
【问题描述】:

我只是想启动一个新的 react-native 应用,但没有运气。

react-native init NewApp cd NewApp npm 安装 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 的 init 版本相同的错误:

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

【问题讨论】:

    标签: react-native


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2021-09-23
      • 2020-08-12
      • 1970-01-01
      • 1970-01-01
      • 2017-04-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-25
      相关资源
      最近更新 更多