Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

YogaKit.modulemap not found after running the IOS Simulator

Tags:

xcode

ios

I have problems running my IOS Simulator within XCode, everytime I try to run the simulator, I get an error message saying:

"fatal error: module map file '/Users/maurice/Library/Developer/Xcode/DerivedData/feedIt-etmfdpwrwadziocunpypqhkwucsd/Build/Products/Debug-iphonesimulator/YogaKit/YogaKit.modulemap' not found"

Expected behavior: XCode runs the simulator.

Actual Behavior: The Build fails and I get the described error message.

I already tried to update Pods and delete the Derived Data, but apparently that didn't work.

How can I fix this issue?

I'm running on MacOS 10.15.5 and XCode 11.6

Error Message

like image 491
Mauri Mark Avatar asked Aug 05 '20 08:08

Mauri Mark


5 Answers

According to the comments in this issue, the problem could be that you opened up .xcodeproj instead of .xcworkspace. Some of the other suggested fixes include:

  1. Make sure your cocoapods build target is the same version as your projects build target. link
  2. Try rebooting your machine. link
  3. Examine your podfile to make sure your build scheme is included in it. link

I was experiencing a similar issue when trying to build the project from the command line and the root issue was that I was using the .xcodeproj instead of .xcworkspace. From what I could tell this error could be caused by multiple different factors.

like image 179
Jesse Hill Avatar answered Nov 20 '22 10:11

Jesse Hill


If you are using M1 chip

  1. Add arm64 in Excluded Architecture enter image description here

  2. Add following lines in podfile enter image description here

  3. Remove node_modules from root, Podfile.lock and Pods from ios folder

  4. Run in root terminal yarn install && cd ios && pod install && pod update

  5. Clean your project and open again

  6. Wait for indexing the project

  7. Run project

like image 13
Chauhan Krunal Avatar answered Nov 20 '22 10:11

Chauhan Krunal


Add this to your Podfile if you are using a M1 chip Mac

    installer.pods_project.build_configurations.each do |config|
      config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
    end
like image 8
monchisan Avatar answered Nov 20 '22 09:11

monchisan


Described solution will work 100% on Apple silicon and while running Xcode without rosetta.

Please try necessary steps only but if still not work than Please try everything including necessary and unnecessary steps.

1 - Not important(Package.json)

"dependencies": {
 "react": "17.0.1",
 "react-native": "0.64.2"
}

2 - necessary

  use_flipper!()
  post_install do |installer|
    react_native_post_install(installer)
        installer.pods_project.build_configurations.each do |config| config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] =  "arm64"
        end
  end

OR

  use_flipper!()

  post_install do |installer|
    react_native_post_install(installer)
      installer.pods_project.targets.each do |target|
          target.build_configurations.each do |config|
            config.build_settings["ONLY_ACTIVE_ARCH"] = "NO"
          end
      end
  end

3 - Add arm64 under Architectures->Excluded Architectures


4 - Add a swift file under your project, can be empty, can be BridgingFile.swift(nothing special in it), this will trigger a bridging header. Wallah, here you go.

enter image description here

like image 9
Samrez Ikram Avatar answered Nov 20 '22 11:11

Samrez Ikram


The issue I was facing when I received this error was, I had opened the wrong file in Xcode. Instead of opening the '.xcworkspace' file, I opened the '.xcodeproj' file.

The solution to this issue is to open the '.xcworkspace' file in Xcode instead of the '.xcodeproj' file.

like image 2
Puranjay Prashanth Avatar answered Nov 20 '22 11:11

Puranjay Prashanth