17

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.

sizzle
  • 2,222
  • 2
  • 21
  • 32

9 Answers9

15

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.

Shiva
  • 11,485
  • 2
  • 67
  • 84
9

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

Guy
  • 2,883
  • 1
  • 32
  • 39
4

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.

Robert
  • 470
  • 4
  • 12
4

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

zak zheng
  • 41
  • 1
2

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.

Muhammad Numan
  • 23,222
  • 6
  • 63
  • 80
2

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
Daniel Tello
  • 520
  • 5
  • 10
1

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

Cparello
  • 607
  • 6
  • 8
0

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.
0

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

Vladimir Salguero
  • 5,609
  • 3
  • 42
  • 47