Detox build 因抛出 YogaKit.modulemap' 致命错误未找到而失败

Kar*_*Rao 10 react-native detox

Detox build 因抛出 YogaKit.modulemap' 致命错误未找到而失败

Xcode 版本:- 11.3 "react": "16.11.0", "react-native": "0.62.2" "detox": "13.3.0",也尝试了最新的 16 版本

但是通过以下配置构建成功

"dependencies": { "react": "^16.3.0-alpha.1", "react-native": "0.59.9" }, "devDependencies": { "babel-jest": "22.4.1", "babel-preset-react-native": "4.0.0", "detox": "13.3.0", "jest": "22.4.2", "mocha": "^5.0.4", "react-测试渲染器": "^16.3.0-alpha.1"

** 构建成功 **

我认为最新版本的 react-native 与 detox 不兼容。我试图为 Yogakit 下定决心,但以失败告终。

如果需要什么,请告诉我。如果有人与最新的 react-native 共享工作配置,我将不胜感激。

`fatal error: module map file ....../ios/build/Build/Products/Debug-iphonesimulator/YogaKit/YogaKit.modulemap' not found 1个错误生成。产生了 20 个错误。致命错误:模块映射文件 '...../ios/build/Build/Products/Debug-iphonesimulator/YogaKit/YogaKit.modulemap' not found 1 错误生成。产生了 22 个错误。

** 构建失败 **

以下构建命令失败:CompileC /....../ios/build/Build/Intermediates.noindex/King.build/Debug-iphonesimulator/King.build/Objects-normal/x86_64/AppDelegate.o /... .../ios/King/AppDelegate.m 正常 x86_64 目标-c com.apple.compilers.llvm.clang.1_0.compiler(1 次失败) detox[29631] 错误:[cli.js] 错误:命令失败:xcodebuild -project ios/King.xcodeproj -scheme King -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build`

小智 26

看看 package.json 中的这个配置

"detox": {
  "configurations": {
    "ios.sim.debug": {
      "binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/example.app",
      "build": "xcodebuild -project ios/example.xcodeproj -scheme example -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build",
      "type": "ios.simulator",
      "device": {
        "type": "iPhone 11 Pro"
      }
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

看看那个

对于 React Native 0.60 或更高版本,或工作区中的任何其他 iOS 应用程序(例如:CocoaPods),请使用 -workspace ios/example.xcworkspace 而不是 -project。

  • 谢谢!我快疯了,直到你注意到使用工作区而不是项目! (4认同)