9

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`

Karthik Rao
  • 119
  • 1
  • 1
  • 7

5 Answers5

25

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.

Mostafa Darwish
  • 350
  • 3
  • 5
3

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.
Umang Loriya
  • 643
  • 6
  • 14
0

Xcode Menu -> File -> Save as Workspace -> (untitled name) and then open that workspace file in the Xcode, it will work

  • go to ios folder
  • open terminal
  • pod update

and then

https://www.youtube.com/watch?v=U30qHiEQWU8

CodeChanger
  • 6,296
  • 1
  • 33
  • 66
Tolga EGE
  • 11
  • 1
0

I'm not sure what this Detox thing is so hopefully this isn't off topic

I came across this question by researching a missing YogaKit.modulemap not found kind of error (sorry I don't have the exact error) which I got after doing a pod install.

I fixed it by opening [project].xcworkspace then at the top Product > Clean Build Folder

OR

shift + command + k

Make sure Xcode has finished cleaning the build before trying to run the project again.

Ryan Sam
  • 1,267
  • 3
  • 8
  • 20
0

On the Podfile target post install ...

post_install do |installer|
    flipper_post_install(installer)
    installer.pods_project.targets.each do |target|
        if target.name == 'YogaKit'
          target.build_configurations.each do |config|
            config.build_settings['SWIFT_VERSION'] = '4.1'
          end
        end
    end
  end