fatal error: module map file YogaKit.modulemap not found

Viewed 15863

I am trying to build an iOS app and get this error. I have the project, target, and podfile all specifying iOS deployment target of 14.2. I am using Xcode V12.2.

fatal error: module map file '/Users/USERNAME/Library/Developer/Xcode/DerivedData/APPNAME-hevjyrbzqmxstztjalctjwmbxffm/Build/Products/Debug-iphonesimulator/YogaKit/YogaKit.modulemap' not found 1 error generated.

When I navigate to that directory I do not see the YogaKit.modulemap file in there. How do I configure the build to copy it to that directory or otherwise fix this error?

I am opening the .xcworkspace project file.

I already did:

rm -rf ~/Library/Developer/Xcode/DerivedData/
pod deintegrate
pod update

This is an expo ejected bare app using react-native 0.63.3 and cocoapods v1.10.0. I'm building on a Mac Mini M1.

Any help would be greatly appreciated.

7 Answers

In my case, I had opened the file myapp.xcodeproj and tried to build/archive the project. I could not build because the build always failed.

This time I selected File > Open > Selected the ios directory in my project i.e. myapp>packages>myapp>ios . Then, I tried to build the app. This time it worked.


You make sure you open myapp.xcworkspace file instead of .xcodeproj.

Make sure that the iOS deployment target version is equal or higher than the version in the podfile

Pod file target Pod file target

Xcode deployment target Xcode deployment Target

Try set "Open using Rosetta" open your Xcode Worked for me

Check your project AND target's 'Build Settings', search with keyword 'valid_archs', if valid_archs config item exists, make sure the value for key DEBUG is 'arm64 armv7 x86_64', in other words, make sure the value contains x86_64.

I managed to resolve the issue in my app. I had a mismatch between the ios version in Xcode and Podfile.

Podfile

image

Xcode

image

I changed my Podfile to platform :ios, '9.0' and ran pod install again. That did the trick.

In my case, I had to do the following, to get the Archive working with XCode 12 in React Native project,

  1. Made sure the same Deployment Target is set correctly across project settings in Xcode and pod file
  2. Turn off optimisation in the release mode by setting Optimisation Level to None (GCC_OPTIMIZATION_LEVEL = 0).
  3. Delete the podfile.lock, and do a fresh pod install.

I added

    installer.pods_project.build_configurations.each do |config|
      config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
    end

To my Podfile in the following loop:

post_install do |installer|

end

Like:

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
Related