module map file '/Users/hosein/Library/Developer/Xcode/DerivedData/Sporty-ficshtjjzxcsgkaohfxowaxpyivr/Build/Products/Debug-iphonesimulator/YogaKit/YogaKit.modulemap' not found

Hi
I bought the new MacBook Air m1 and install Xcode 12 on that and I try to run my React Native project on that but I could run normally on intel base MacBook (my old macbook).
I face with some error in my new MacBook.

I see this errors:

1- building for iOS Simulator, but linking in object file built for iOS, file '/Users/hosein/Desktop/sporty-app/ios/Pods/OpenSSL-Universal/ios/lib/libcrypto.a' for architecture arm64
  • I fixed this with adding the arm64 on Excluded Architectures



2- module map file '/Users/hosein/Library/Developer/Xcode/DerivedData/Sporty-ficshtjjzxcsgkaohfxowaxpyivr/Build/Products/Debug-iphonesimulator/YogaKit/YogaKit.modulemap' not found


I get number 2 when I want run app on simulator but when I run on real device I don't have any errors.

How can I fix this error (number 2)?

Note: I am running the xxxx.xcworkspace and my target iOS version in pod and general in Xcode is 10.0
  • you are opened YourAppName.xcodeproj file in your xcode thats why this error begins close the xcode then open xcode and click on open new project and select YourAppName.xcworkspace file and then first clean the build folder then click on product and then build. and here your problem solved

Add a Comment

Accepted Reply

Actually, was facing same issue on Mac Mini with M1 processor, please try to open Xcode through Rosetta - Right click on Xcode in applications folder -> Get Info -> set Open with Rosetta to true

Please follow steps below:
https://github.com/facebook/react-native/issues/29605#issuecomment-762354328

Replies

I am running into the exact same issue with a new M1 macbook pro.

I was able to create a brand new React Native project and run it in a simulator no problem so it seems to be an issue with existing projects.
I wasted my whole day to looking an answer for this issue, still no luck. Have anyone found a way to solve this? Agree with @AustinAndrews , having issue with existing projects, not new.
Actually, was facing same issue on Mac Mini with M1 processor, please try to open Xcode through Rosetta - Right click on Xcode in applications folder -> Get Info -> set Open with Rosetta to true

Please follow steps below:
https://github.com/facebook/react-native/issues/29605#issuecomment-762354328
Vladko Krasavello! I was looking all days the decision, but nothing worked for me. Only your decision. Thank you so much)))
  • vadko thankyotu verymuch

Add a Comment

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.

https://i.stack.imgur.com/rV2pk.png

  • Thanks man the 2-nd, 3-rd, and 4-th steps helped me.

  • This was also the solution that worked for me. Thanks this was driving me crazy!

Add a Comment

Thanks. But it's Voilà, not "Wallah". Please don't tarnish the French language like that.

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.

  • This is the most likely cause for that error.

Add a Comment