Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detox build is failing by throwing YogaKit.modulemap' fatal error not found

Detox build is failing by throwing YogaKit.modulemap' fatal error not found

Xcode Version:- 11.3 "react": "16.11.0", "react-native": "0.62.2" "detox": "13.3.0", tried latest 16 version as well

But build got succeeded with the below configuration

"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-test-renderer": "^16.3.0-alpha.1"

** BUILD SUCCEEDED **

I think latest version of react-native is not compatible with the detox. I tried to get resolve for Yogakit, but ended with no luck.

Please let me know if anything is required. I would be thankful if someone shared the working config with the latest react-native.

`fatal error: module map file ....../ios/build/Build/Products/Debug-iphonesimulator/YogaKit/YogaKit.modulemap' not found 1 error generated. 20 errors generated. fatal error: module map file '...../ios/build/Build/Products/Debug-iphonesimulator/YogaKit/YogaKit.modulemap' not found 1 error generated. 22 errors generated.

** BUILD FAILED **

The following build commands failed: CompileC /....../ios/build/Build/Intermediates.noindex/King.build/Debug-iphonesimulator/King.build/Objects-normal/x86_64/AppDelegate.o /....../ios/King/AppDelegate.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (1 failure) detox[29631] ERROR: [cli.js] Error: Command failed: xcodebuild -project ios/King.xcodeproj -scheme King -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build`

like image 721
Karthik Rao Avatar asked Apr 18 '20 23:04

Karthik Rao


2 Answers

take a look at this config in 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"
      }
    }
  }
}

and take a look at that

For React Native 0.60 or above, or any other iOS apps in a workspace (eg: CocoaPods) use -workspace ios/example.xcworkspace instead of -project.

like image 104
Mostafa Darwish Avatar answered Nov 20 '22 19:11

Mostafa Darwish


This is how I got it working:

  1. Open xcworkspace file
  2. Click on this : http://files.simformsolutions.com.s3.amazonaws.com/simformscreen/ReactN.xcworkspace_2020-09-17_12-48-42.png
  3. You will see such available options for your project/app as update project settings to recommended : http://files.simformsolutions.com.s3.amazonaws.com/simformscreen/ReactN.xcworkspace_2020-09-17_12-49-43.png
  4. Click on the warnings and update the project to recommended settings, for all warnings.
  5. On Convert to swift 5 available, if you click it, it will specifically show you the YogaKit module, click convert.
  6. It will take time and voila!!
  7. The build should succeed this time.
like image 3
Umang Loriya Avatar answered Nov 20 '22 19:11

Umang Loriya