Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xcode 11.4 build fatal error: module map file xxx/Build/Products/Debug-iphoneos/YogaKit/YogaKit.modulemap' not found #28503

Open
rs-frank opened this issue Apr 3, 2020 · 162 comments

Comments

@rs-frank
Copy link

rs-frank commented Apr 3, 2020

Please provide all the information requested. Issues that do not follow this format are likely to stall.

Description

fatal error: module map file '/Users/miaohao/Library/Developer/Xcode/DerivedData/apex_baojia2-cdczyhhwbgshmtbdymitajpzamao/Build/Products/Debug-iphoneos/YogaKit/YogaKit.modulemap' not found

React Native version:

Run react-native info in your terminal and copy the results here.
System:
OS: macOS 10.15.3
CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
Memory: 219.52 MB / 8.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.16.1 - /usr/local/bin/node
Yarn: 1.22.0 - /usr/local/bin/yarn
npm: 6.13.4 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.8.4 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 13.4, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
Android SDK:
API Levels: 23, 24, 25, 26, 27, 28, 29
Build Tools: 26.0.2, 28.0.3
System Images: android-23 | Android TV Intel x86 Atom, android-23 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 3.6 AI-192.7142.36.36.6241897
Xcode: 11.4/11E146 - /usr/bin/xcodebuild
Languages:
Python: 2.7.16 - /usr/local/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.11.0 => 16.11.0
react-native: 0.62.0 => 0.62.0
npmGlobalPackages:
react-native: Not Found

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

1.react-native init XXX
2.cd ios && pod install
3. xcode Product/build

Expected Results

Describe what you expected to happen.

Snack, code example, screenshot, or link to a repository:

Please provide a Snack (https://snack.expo.io/), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem.
You may provide a screenshot of the application if you think it is relevant to your bug report.
Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve
image
image

@apostopher
Copy link

I'm facing the same issue. but only in the release mode. the debug build works fine.

System:
    OS: macOS 10.15.3
    CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
    Memory: 1.05 GB / 32.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 10.17.0 - /usr/local/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.4 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.4, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
  IDEs:
    Xcode: 11.4/11E146 - /usr/bin/xcodebuild

@hramos
Copy link
Contributor

hramos commented Apr 3, 2020

@apostopher this matches what I observed in Circle CI when I verified our iOS tests on Xcode 11.4.0 - no issues at all on debug mode.

@LeviWilliams
Copy link

Facing sporatically in debug as well

@apostopher
Copy link

apostopher commented Apr 4, 2020

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.

@wildlifechorus
Copy link

I have this issue too. And it's not a mismatch between versions.

@arjndr
Copy link

arjndr commented Apr 5, 2020

I had this issue too, I'm not very familiar with XCode, but I opened the .xcodeworkspace file and then clicked build, which was successful!

@wangxum168
Copy link

wangxum168 commented Apr 5, 2020

Same issue.
React Native -> 0.62
Xcode -> 11.4
After you create the app. it shows that:
image
It asks you to use .xcodeworkspace file to run, but I just want to know why I have this error in the .xcodeproj flie.

@rs-frank
Copy link
Author

rs-frank commented Apr 6, 2020

use .xcodeworkspace is ok

@stephanos7
Copy link

use .xcodeworkspace is ok

not sure why the many thumbs up? is this working for people? The above problem happens also when running .xcodeworkspace in xcode.

@ghost
Copy link

ghost commented Apr 9, 2020

I am also facing the same issue. Not sure what to do from here.

@NiklasMencke
Copy link

also the same issue and stuck here :(

@ghost
Copy link

ghost commented Apr 10, 2020

If I run my project from project workspace then this error deosn't show up. And whenever you are using pods. You should always run your project from workspace

@eoinnorris
Copy link
Contributor

People who are saying this is caused by not using the workspace aren't really being helpful. Thats not the cause of this specific bug, most people who use Pods would know to use the workspace, not the project.

@collamo
Copy link

collamo commented Apr 12, 2020

XCode:11.4
React Native:0.62.2
For me, changing the Build System from "Legacy Build System" to "New Build System" fixed this problem.

@siwonia
Copy link

siwonia commented Apr 12, 2020

I'm not 100% sure if the first line did the trick, or if it was just a terminal restart, but this worked for me:

sudo xcode-select --switch /Applications/Xcode.app

restart terminal (important)

cd ios && pod install

@wangxum168
Copy link

wangxum168 commented Apr 13, 2020

Same issue.
React Native -> 0.62
Xcode -> 11.4
After you create the app. it shows that:
image
It asks you to use .xcodeworkspace file to run, but I just want to know why I have this error in the .xcodeproj flie.

my solution is to add the library MANUALLY:
image
Then, it just works!

@giacomoalonzi
Copy link

giacomoalonzi commented Apr 15, 2020

I've incurred in the same error, it doesn't work also with blank RN project.

System:
    OS: macOS 10.15.4
    CPU: (8) x64 Intel(R) Core(TM) i5-8279U CPU @ 2.40GHz
    Memory: 26.77 MB / 8.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 10.16.0 - /var/folders/mm/zm3z3hx96p7_9jxhs_6f8v2h0000gn/T/yarn--1586964002884-0.9192953256519525/node
    Yarn: 1.22.4 - /var/folders/mm/zm3z3hx96p7_9jxhs_6f8v2h0000gn/T/yarn--1586964002884-0.9192953256519525/yarn
    npm: 6.14.4 - ~/.nvm/versions/node/v10.16.0/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.9.1 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 13.4, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
    Android SDK: Not Found
  IDEs:
    Android Studio: 3.6 AI-192.7142.36.36.6241897
    Xcode: 11.4/11E146 - /usr/bin/xcodebuild
  Languages:
    Java: 13.0.2 - /usr/bin/javac
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.11.0 => 16.11.0 
    react-native: 0.62.2 => 0.62.2 
  npmGlobalPackages:
    *react-native*: Not Found

@bunsha
Copy link

bunsha commented Apr 16, 2020

Same issue. started from nowhere. Done nothing, except internal js logic change.

@giacomoalonzi
Copy link

Same issue. started from nowhere. Done nothing, except internal js logic change.

If I can help you, I solved with a reboot. I mean, I did just a reboot of osx, opened the .xcworkspace file and it worked.

@bunsha
Copy link

bunsha commented Apr 19, 2020

Same issue. started from nowhere. Done nothing, except internal js logic change.

If I can help you, I solved with a reboot. I mean, I did just a reboot of osx, opened the .xcworkspace file and it worked.

thank you. I solved it by turning off this stupid icloud backup. First of all - its rly slows down everything, and second - its just start copying some files from my project, and i belive simply corrupt one of the files during the process.

@Shaharsha
Copy link

+1 :(

@Shaharsha
Copy link

In my case the problem was in the provisioning profile. I fixed it by checking "Automatically manage signing" in Xcode -> Signing & Capabilities, and Choosing a Team.

@temitopealabi
Copy link

still having issues to build my project through xcode 11..on screen error is YogaKit.modulemap not found...any assistance will be highly appreciated..
I have tried different suggested solution out here but none work for me

@temitopealabi
Copy link

still having issues to build my project through xcode 11..on screen error is YogaKit.modulemap not found...any assistance will be highly appreciated..
I have tried different suggested solution out here but none work for me

Finally, I found a fix
finally i resolved the problem you have to give xcode full disk access all toy have to do
1- open system preference
2- open security & privacy
3- click on full disk access
4- click on the light yellow padlock in order to add xcode to the list
5-click on + button to add new app and choose xcode
6- dropdown will open then click on Applications
7- Double click on Xcode
8-click on yellow padlock to lock the folders back
9- close xcode
10 -go to your project
run below code
Go to your project ios folder
then click on .xcworkspace extension file to open your project with xcode
click on Project tab then click click on clean project
Now click on build project or the play button

@alexma01
Copy link

I had the same problem after updating to the latest version of xcode. The problem solved itself by restarting the mac.

@mjstelly
Copy link

mjstelly commented Feb 9, 2022

After trying every solution on the internet, this worked for me.

cd ios && pod install && cd .. then npx react-native link or yarn react-native link

react-native link is deprecated. It mentions this in the launch sequence:

error React Native CLI uses autolinking for native dependencies, but the following modules are linked manually:

  • react-native-device-info (to unlink run: "react-native unlink react-native-device-info")
    This is likely happening when upgrading React Native from below 0.60 to 0.60 or above. Going forward, you can unlink this dependency via "react-native unlink " and it will be included in your app automatically. If a library isn't compatible with autolinking, disregard this message and notify the library maintainers.

@zoobibackups
Copy link

zoobibackups commented Mar 11, 2022

My issue resolve by this:

Xcode v11.0/ 11.4/ 12.0 // working with all these

use_flipper!({ 'Flipper' => '0.91.1' })
  post_install do |installer|
    flipper_post_install(installer)
 end
"react": "17.0.2",
"react-native": "0.67.3",

Make sure you update the pod using pod update command and clean the build after updating.

@edglo98
Copy link

edglo98 commented Mar 31, 2022

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.

this works for me, could there be any impact?

@musabgulfam
Copy link

Still facing this issue

@macci10
Copy link

macci10 commented May 13, 2022

I solved this issue by adding 3 liner code in PodFile on my m1 macbook.

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

Full Example below

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
   installer.pods_project.targets.each do |target|
     if (target.name&.eql?('FBReactNativeSpec'))
       target.build_phases.each do |build_phase|
         if (build_phase.respond_to?(:name) && build_phase.name.eql?('[CP-User] Generate Specs'))
           target.build_phases.move(build_phase, 0)
         end
       end
     end
   end
  end

@Garretming
Copy link

Garretming commented May 13, 2022 via email

@herparis
Copy link

herparis commented Jun 8, 2022

  • 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

@Garretming
Copy link

Garretming commented Jun 8, 2022 via email

@lucky-009
Copy link

pod install try

@Garretming
Copy link

Garretming commented Jul 11, 2022 via email

@pprasha
Copy link

pprasha commented Jul 15, 2022

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.

@codemobiles
Copy link

In my case M1, I have proven the suggestion above. If anyone can run via opening *.xcworkspace but cannot run via terminal app or terminal in vscode. You just re-open the terminal or vscode first and try to run again. Now it works without any errors.

@cglacet
Copy link

cglacet commented Aug 1, 2022

Does anyone have an idea how to debug this kind of issue? I tried many of the suggested soluions but I still have this error (several missing .modulemap files). It seems like the build is supposed to move this files by itself because the location is something that is not part of my folder structure (something like /Users/mylogin/Library/Developer/Xcode/DerivedData/Project-<random-uid>/Build/Products/Development.Release-iphonesimulator/YogaKit/YogaKit.modulemap even when I'm explicitely building using a configuration called Staging.Debug, not Development.Release).

I really struggle understanding builds (and therefore its hard to figure out what is going on). Everything is a bit too opaque and the terminology is very complex (workspace, projet, target, scheme, configuration, pods, …).

EDIT: I found the current issue, I had to add the following in my Podfile:

project 'Project', 
  'Release' => :release, 
  'Staging.Release' => :release, 
  'Development.Release' => :release, 
  'Debug' => :debug,
  'Staging.Debug' => :debug,
  'Development.Debug' => :debug

@marlonschlosshauer
Copy link

In my case M1, I have proven the suggestion above. If anyone can run via opening *.xcworkspace but cannot run via terminal app or terminal in vscode. You just re-open the terminal or vscode first and try to run again. Now it works without any errors.

This solved it for me. I had previously built from Xcode, which also launched the terminal. I reused that terminal instance and kept getting a wall of text when running npm run ios. Restarted my M1 and it worked fine again.

@waqaskhanroghani
Copy link

ANY Solution ???

Error:
The following build commands failed:
CompileC /Users/apple/Library/Developer/Xcode/DerivedData/CCMS-fstgkackpdifrgfsclbkhczdgkkb/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-jsi.build/Objects-normal/x86_64/JSIDynamic.o /Users/apple/Bircube/QR-Scanner/node_modules/react-native/ReactCommon/jsi/jsi/JSIDynamic.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'React-jsi' from project 'Pods')
(1 failure)

@Garretming
Copy link

Garretming commented Nov 4, 2022 via email

@w8ight
Copy link

w8ight commented Nov 17, 2022

Tried almost all the solutions from thread - nothing helped, Xcode kept showing the error. But for some reason was able to build app from Terminal by running react-native run-ios --simulator=\"iPhone 14 Pro\"

@AlkanV
Copy link

AlkanV commented Nov 29, 2022

I'm not 100% sure if the first line did the trick, or if it was just a terminal restart, but this worked for me:

sudo xcode-select --switch /Applications/Xcode.app

restart terminal (important)

cd ios && pod install

you are a hero my friend. some heros does not wear capes.

@alvesrafa
Copy link

alvesrafa commented Dec 13, 2022

check if u have .xcode.env in your /ios folder
if u dont have, try to create with this:

.xcode.env

# This `.xcode.env` file is versioned and is used to source the environment
# used when running script phases inside Xcode.
# To customize your local environment, you can create an `.xcode.env.local`
# file that is not versioned.

# NODE_BINARY variable contains the PATH to the node executable.
#
# Customize the NODE_BINARY variable here.
# For example, to use nvm with brew, add the following line
# . "$(brew --prefix nvm)/nvm.sh" --no-use
export NODE_BINARY=$(command -v node)

after created, re-open your project in xcode.

@LucasBerger
Copy link

I recently switched to using the m1/arm64 version of cocoapods and removed the "Run with Rosetta" in XCode. I forgot to remove "arm64" from the excluded architectures.

@zhuiye
Copy link

zhuiye commented May 12, 2023

I solved this issue by adding 3 liner code in PodFile on my m1 macbook.

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

Full Example below

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
   installer.pods_project.targets.each do |target|
     if (target.name&.eql?('FBReactNativeSpec'))
       target.build_phases.each do |build_phase|
         if (build_phase.respond_to?(:name) && build_phase.name.eql?('[CP-User] Generate Specs'))
           target.build_phases.move(build_phase, 0)
         end
       end
     end
   end
  end

bro,save my life ,i use m2/ mini,

@BrewCurious
Copy link

For whatever it's worth, I found that opening either the <project_name>.xcodeproj or the <project_name>.xcworkspace files in Xcode came up unbuildable. Either I had access to all of my project files, but ran into a series of "Module not found" messages or I had access to all of the Pods configuration information, but no way to build the app for testing or archiving.

When I opened the directory in which all of those files were located, however, I had both the app build files as well as the pod configurations available within the navigation pane of Xcode and running the code successfully built and launched into either the simulator or archive.

Maybe just my situation, but there you are.

@Yasir12598
Copy link

In my case I resolved by enabling the rossetta in xcode 14.3 link

@fukemy
Copy link

fukemy commented Oct 3, 2023

any solution for XCode 15?

@Vorobeyko
Copy link

Vorobeyko commented Oct 7, 2023

I fixed this problem for me, when i set arm64 to exluded arch
image

@sajjad-karimi
Copy link

in my case I just set Build Active Architecture Only Debug to Yes ,
from Buid Settings
Screenshot 2023-11-15 at 2 51 26 PM

@leechanghoon3024
Copy link

@macci10
Good. Thank you

@lukebrandonfarrell
Copy link

lukebrandonfarrell commented May 30, 2024

I had this issue sporadically when trying to run detox build, which runs the xcodebuild -workspace command. The first time it came up, I solved it by upgrading my system's Ruby version from 2.6.10 to 2.7.5. The second time, I solved it by closing Xcode and simulators, removing and reinstalling /node_modules and /ios/Pods, and rerunning the command. Somehow, the error vanished 🤷

I suspect there is an issue in the build process that results in module map files not being generated, possibly some race condition.

Edit: also, restart your computer after removing and reinstalling, as some case removing and reinstalling does not work 🤷

@ketan-pcs
Copy link

use .xcodeworkspace is ok and
I'm not 100% sure if the first line did the trick, or if it was just a terminal restart, but this worked for me:

sudo xcode-select --switch /Applications/Xcode.app

restart terminal (important)

cd ios && pod install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests