Mauri Mark
Mauri Mark

Reputation: 569

YogaKit.modulemap not found after running the IOS Simulator

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

Upvotes: 56

Views: 93631

Answers (15)

Choi Jiho
Choi Jiho

Reputation: 1

Sadly, All of the above answers have not solved it. I spent 2 days just searching, and now it's resolved.

Podfile:

pod 'YogaKit', '~> 1.7'

pod deintegrate && pod setup && pod install

Upvotes: 0

mdiin
mdiin

Reputation: 415

I was seeing this error with a different package and in a React Native setting, and could not find anything on how to fix it. After a lot of trial and error I found a solution:

  1. Open the ios/Pods/Pods.xcodeproj in XCode
  2. That showed a number of warnings in the Pods project, which XCode suggested it could fix
  3. Ask XCode to fix the warnings

After this I was able to build the project again, both through XCode and using the React Native tooling.

Upvotes: -2

Harshal
Harshal

Reputation: 8308

I have got an M1 mac setup. The above methodologies were not working for me. However, this worked: Run XCode Rosetta

Finder -> Xcode in applications folder -> Get Info -> set Open with Rosetta to true

Xcode is now under Rosetta.

enter image description here

Upvotes: 2

JAK
JAK

Reputation: 6491

make sure to your deployment target should be same in podfile, project and target.

Upvotes: 1

Puranjay Prashanth
Puranjay Prashanth

Reputation: 129

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.

Upvotes: 11

Ragu Ram
Ragu Ram

Reputation: 69

in my case, this is solved by changing build active architecture only > release > yes in build settings

Upvotes: 1

user15954220
user15954220

Reputation: 1

  • run brew uninstall watchman
  • run brew install watchman or arch arm64 brew install watchman if you are on an M1
  • closed the current terminal (console) session
  • open it again and go to the project directory
  • cd ios && rm -rf Pods Podfile.lock && pod install --repo-update
  • run watchman watch-del-all
  • if you have the iOS simulator opened, closed it
  • run yarn react-native run-los

Upvotes: -1

Chauhan Krunal
Chauhan Krunal

Reputation: 329

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

Upvotes: 31

duongvanthai
duongvanthai

Reputation: 1556

Once of reason can export this error is setting on User-Defined. Recently, I pull a project to continue dev. I can't build it on simulator. It's always so this error.

Module map not found

for all lib. Its take me a lot of times to fix this. I check of all config & found problem is previous dev set VALID_ARCHS are only: arm64e armv7s arm64

I changed it to both ios device & simulator: arm64 arm64e armv7 armv7s x86_64 or simple delete VALID_ARCHS from User-Defined.

Now it can work. Hope this help :-)

Upvotes: -1

Samrez Ikram
Samrez Ikram

Reputation: 601

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

Upvotes: 14

Hadis
Hadis

Reputation: 594

try running the project on on terminal with this command: npx react-native run-ios and the run it on Xcode again

Upvotes: 0

monchisan
monchisan

Reputation: 658

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

Upvotes: 16

Vitaliy Fedorka
Vitaliy Fedorka

Reputation: 29

I have solved this problem with adding to Debug Any iOS Simulator SDK with value arm64 to excluded architecture in Pods project (apple MacBook Pro m1)

Upvotes: 2

Irshad KK
Irshad KK

Reputation: 63

The issue for me was not setting the VALID_ARCHS = "arm64 arm64e armv7 armv7s x86_64"; like this in xyzApp/ios/xyzApp.xcodeproj/project.pbxproj

Upvotes: 0

Jesse Hill
Jesse Hill

Reputation: 1994

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.

Upvotes: 115

Related Questions