sizzle
sizzle

Reputation: 2332

fatal error: module map file YogaKit.modulemap not found

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.

Upvotes: 18

Views: 27832

Answers (9)

Cparello
Cparello

Reputation: 1585

I had this problem, for me I just did npm install in the root and pod install in the /ios folder

Upvotes: 1

Vladimir Salguero
Vladimir Salguero

Reputation: 5947

I solved using the next code in Podfile ..proyect/ios/Podfile

post_install do |installer|
  react_native_post_install(installer)
  __apply_Xcode_12_5_M1_post_install_workaround(installer)
  #To fix issue _OBJC_CLASS_$_RCTBundleURLProvider
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      # config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
      # To solve xcode 14 issue not signing some pod projects
      config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
      config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
      config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
    end
  end
end

enter image description here

Upvotes: 0

Daniel Tello
Daniel Tello

Reputation: 639

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

Upvotes: 3

Shiva
Shiva

Reputation: 12562

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.

Upvotes: 19

Muhammad Numan
Muhammad Numan

Reputation: 25393

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.

Upvotes: 2

Guy
Guy

Reputation: 3096

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

Upvotes: 9

user15380744
user15380744

Reputation: 1

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.

Upvotes: 0

zak zheng
zak zheng

Reputation: 51

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

Upvotes: 5

Noodles
Noodles

Reputation: 530

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.

Upvotes: 4

Related Questions