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

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® Core™ 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

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 190
  • Comments: 160 (9 by maintainers)

Commits related to this issue

Most upvoted comments

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!

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.

use .xcodeworkspace is ok

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

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.

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

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

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.

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.

Hi there,

The only way for me to fix this was to switch Target from 9.0 to 11.00 Hopefully, it helps someone. Screen Shot 2020-05-06 at 7 26 51 PM

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!

Hi,

I tried ALL of the above solutions, they did not work for me. What did work for me was

  • Open xcode .xcworkspace file
  • Try build
  • It should fail with the Yogakit.modulemap error
  • With error it should also show you some warnings, along the lines of update project settings to recommended this warning should be listed twice, one for POD project and one for your app project
  • Click on the warnings and update the project to recommended settings, for both warnings.
  • Then, it should also show you another warning Convert to swift 5 available, if you click it, it will specifically show you the YogaKit module, click convert.
  • Its gonna take time, go drink a coffee or something.
  • When its done, click build again, thats also gonna take time, this time, take your family for lunch or dinner.
  • The build should succeed this time.

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.

Hello,

Here my solution :

  • uninstall xcode
  • restart computer
  • install xcode 12.2
  • expo init ProjectName
  • cd ProjectName
  • expo-cli login (type email & password)
  • expo eject --no-install
  • npm install
  • cd ios/
  • pod install
  • cd ..
  • react-native run-ios

Enjoy !

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

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 solved my issue. Instead of changing the Podfile version I:

  • Selected my app and navigated to the General tab
  • Scroll to Deployment Info
  • Changed iOS 9.0 to iOS 11.0

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

Perhaps you guys opened up .xcodeproj and not the .xcworkspace

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

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

Here’s intel or m1 / apple silicon mac working in debug and release on react-native 0.65 with hermes and flipper. It’s a mess!


  post_install do |installer|
    react_native_post_install(installer)

    installer.aggregate_targets.each do |aggregate_target| 
      aggregate_target.user_project.native_targets.each do |target|
        target.build_configurations.each do |config|
          config.build_settings['LIBRARY_SEARCH_PATHS'] = ['$(SDKROOT)/usr/lib/swift', '$(inherited)'] # or it won't build on apple silicon
          # without explicitly clearing this out, it flaps between excluding arm64 or not
          config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "" # stop this setting from waffling between arm65/x86_64 machines after pod install
          # Fix some library / linker errors
          config.build_settings['ONLY_ACTIVE_ARCH'] = 'YES' # only one at a time
          config.build_settings['VALID_ARCHS'] = 'arm64 x86_64' # you need both to work on both CPU archs / release etc
          config.build_settings['EXCLUDED_ARCHS'] = 'i386' # or you get directory not found linker errors
        end
      end
      aggregate_target.user_project.save
    end

    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|

        # We support a smaller range of deployment than some libraries, eliminate related noise
        # This also avoids a nasty Folly bug about an API not available until ios10+
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = $iOSMinimumDeployVersion
      end
    end

    # If you move versions around though you get another nasty Folly bug about redefined symbols, fix that...
    `sed -i -e  $'s/__IPHONE_10_0/__IPHONE_12_0/' Pods/RCT-Folly/folly/portability/Time.h`

  end

Disclaimer: I’ve M1 mac setup. The above methodologies were not working for me. However this worked: Run XCode in Rosetta.

Xcode in applications folder -> Get Info -> set Open with Rosetta to true

More info https://developer.apple.com/forums/thread/670006

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

Excluded architectures in pod file get removed on pod install sometimes.

Screen Shot 2021-01-31 at 1 54 24 PM

That fixes it. (Mac M1)

open xxx.xcworkspace rather than xxx.xcodeproj make success

Disclaimer: I’ve M1 mac setup. The above methodologies were not working for me. However this worked: Run XCode Rosetta.

Xcode in applications folder -> Get Info -> set Open with Rosetta to true

More info https://developer.apple.com/forums/thread/670006

Crazy how you just saved me from insanity. This should be pinned on the home page of GitHub and SO for every M1 user so they can avoid losing DAYS. Xcode is now under Rosetta forever, Hyper as well.

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


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.

Facing sporatically in debug as well

已收到,我会尽快回复的了!

remove Podfile.lock, next use_flipper!({ 'Flipper' => '0.91.1' }) and pod install

I have tried many suggestions. None of them work for me

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.

已收到,我会尽快回复的了!

I was facing the same problem. What fixed for me was going to Edit Scheme… -> Run -> Change Build Configuration to Release.

I was banging my head trying every answer here with no luck.

I had no problem running the project from Xcode, but I stubbornly really wanted the ability to run the project via react-native run-ios from the command line using iTerm.

In an effort to debug, I run the same command from my VSCode terminal, and it worked! Why? Why… I yelled inside.

So I restarted my iTerm, and it began working. I’m not sure what’s happening under the hood with iTerm, but a simple restart fixed my issue.

Hi there,

The only way for me to fix this was to switch Target from 9.0 to 11.00 Hopefully, it helps someone. Screen Shot 2020-05-06 at 7 26 51 PM

Man you totally saved my life. I found out that in Podfile I set the target to 11.0 but in XCode setting it was still 9.0, setting them both to the same version did the trick, thank you so much!

已收到,我会尽快回复的了!

已收到,我会尽快回复的了!

Here’s intel or m1 / apple silicon mac working in debug and release on react-native 0.65 with hermes and flipper. It’s a mess!

  post_install do |installer|
    react_native_post_install(installer)

    installer.aggregate_targets.each do |aggregate_target| 
      aggregate_target.user_project.native_targets.each do |target|
        target.build_configurations.each do |config|
          config.build_settings['LIBRARY_SEARCH_PATHS'] = ['$(SDKROOT)/usr/lib/swift', '$(inherited)'] # or it won't build on apple silicon
          # without explicitly clearing this out, it flaps between excluding arm64 or not
          config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "" # stop this setting from waffling between arm65/x86_64 machines after pod install
          # Fix some library / linker errors
          config.build_settings['ONLY_ACTIVE_ARCH'] = 'YES' # only one at a time
          config.build_settings['VALID_ARCHS'] = 'arm64 x86_64' # you need both to work on both CPU archs / release etc
          config.build_settings['EXCLUDED_ARCHS'] = 'i386' # or you get directory not found linker errors
        end
      end
      aggregate_target.user_project.save
    end

    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|

        # We support a smaller range of deployment than some libraries, eliminate related noise
        # This also avoids a nasty Folly bug about an API not available until ios10+
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = $iOSMinimumDeployVersion
      end
    end

    # If you move versions around though you get another nasty Folly bug about redefined symbols, fix that...
    `sed -i -e  $'s/__IPHONE_10_0/__IPHONE_12_0/' Pods/RCT-Folly/folly/portability/Time.h`

  end

Thank you, confirming this worked for me. Resolving this issue on M1 without having to use x86_64.

I run npx react-native run-ios on Vs code and work fine. Then I opened the . xcworkspace file on XCode and it worked too

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

Solved: 1) open terminal and run “npx react-native run-ios” and await end load 2) open xcode and run app on simulator or run archive app that ALL! Welcome!

Got the same error on Xcode 12. None of the above solutions worked. This error only happens when using a emulator instead of a real device.

Xcode 12. React Native: 0.63.2, +1

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

make sure the Yogakit iOS deployment target match, This worked for me!!! image

Guys I have the same problem on Macbook M1, Xcode 12.4, react-native: 0.63.4, React Native project from scratch, worked just a few days, I did not make any IOS changes, and after build failed:

fatal error: module map file ‘/Users/jocoders/Library/Developer/Xcode/DerivedData/CryptoWalletApp-hfiwvoyqlbgufkgtyvqtxygiaodf/Build/Products/Debug-iphonesimulator/YogaKit/YogaKit.modulemap’ not found

I tried a lot of ways from this tread, but nothing works for me. Any new decisions? Please 🙏🙏🙏

Tried everything, what worked was to delete the whole DerivedData folder, when running react-native run-ios again it just worked. Located in: /Users/YOUR-USER/Library/Developer/Xcode/DerivedData/

Just rm -rf /Users/YOUR-USER/Library/Developer/Xcode/DerivedData/

Still facing this issue

Xcode12 still not working. I tried all of those solutions and none of them work for me. Need help urgently

it doesn’t work when I run a blank RN project from Xcode, but it does work from terminal. Could this react native shit be more tricky???

Sure. I demonstrate exactly what you want with this full-featured template: https://github.com/invertase/react-native-firebase-authentication-example - I help maintain react-native-fbsdk-next, react-native-google-signin, react-native-firebase, and have worked on the patches that make react-native itself work on the M1. It all works, or should work. Please be careful with the word “shady” when used in conjunction with hack. Some hacks are beautiful. Some are ugly, but none really deserve a moral label applied to them. Think in terms of “understandable”, “localized”, “functional”, “temporary” as criteria. The M1 “hack” required for react-native is understandable, localized, functional and temporary, and as such if you wanted to get moral with it, is a beautiful thing.

Curious to hear if that template, used in conjunction with Xcode 13.2.1 and cocoapods 11.2 has any issues for you while running native / no rosetta on M1. It should work.

Everything magically worked again after restarting the Terminal

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 solved the issue for me. I had platform :ios, '11.0' in my Podfile, but 10.0 as the iOS version in Xcode. I changed the iOS version to 11.0 in Xcode and was afterwards able to generate the archive. Thank you!

M1 mac - setup:

Screenshot 2021-04-18 at 22 14 22

plus I added in Podfile:

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

After remove Podfile.lock and Pods and re-run pod install

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?

None of the answers above fixed my problem. I was already using .xcodeworkspace and platform target was the same in Xcode and in Podfile.

I fixed this issue by adding this line to Podfile:

config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"

This example shows where to write the line above:

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['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
               config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64" // here
          end
     end
end

Asking people to remove features is not an acceptable fix to a problem.

If you are on an M1 Mac, you may need to use `arch --x86_64’ when building from command line or run Xcode through Rosetta. Often times after a successful deploy you can switch back to Apple Silicon, but not always.

Otherwise, there is a larger issue at hand that seems to be unrelated to React Native but should still be solved, especially as this issue seems to occur more when whenever Apple updates Xcode. The error is correct - if you check the folder Debug-iphoneos it won’t contain any folders aside your app’s build, something is causing the build process to not generate module maps at all.

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

this helped. fml 🤦

For projects that use pods ( which it did for me because I’m using RN63 ) I found that I had to set the version of IPHONEOS_DEPLOYMENT_TARGET for all the pods installed in the app, the version had to be consistent with what the version specified in platform :ios and with the version specified in Xcode. Making the version consistent across the whole project solved the issue.

To set IPHONEOS_DEPLOYMENT_TARGET for all the pods you need to add:

  post_install do |installer|
	installer.pods_project.targets.each do |target|
		target.build_configurations.each do |config|
		config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
		end
	end
  end

and then run pod install

terminate Xcode and run again. Worked for me

Hi,

I tried ALL of the above solutions, they did not work for me. What did work for me was

* Open xcode .xcworkspace file

* Try build

* It should fail with the Yogakit.modulemap error

* With error it should also show you some warnings, along the lines of **update project settings to recommended** this warning should be listed twice, one for POD project and one for your app project

* Click on the warnings and update the project to recommended settings, for both warnings.

* Then, it should also show you another warning **Convert to swift 5 available**, if you click it, it will specifically show you the YogaKit module, click convert.

* Its gonna take time, go drink a coffee or something.

* When its done, click build again, thats also gonna take time, this time, take your family for lunch or dinner.

* The build should succeed this time.

I didnt work for me, get the error !

resim

In my User-Defined section of Build Settings I have VALID_ARCHS defined as arm64 arm64e armv7s because some of my libraries do not support older architectures. I need this to build on device and for release but it seems that it breaks the simulator for Xcode 12. By removing VALID_ARCHS from my build settings my simulators will build but I have to put the setting back for devices or releases. Hope this helps somebody!

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.

My specific issue was that running react-native run-ios failed. But in Xcode (of course, opening the .xcworkspace) worked like a charm. Surprisingly… After trying everything in here, the reboot worked for me 😨 After the reboot the react-native run-ios also worked…

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

@yemd Xcode should not be under Rosetta, nothing should be under Rosetta. There are real updates to the software in use that should have everything working fine without Rosetta. Next version of react-native actually checks and complains if you attempt to use Rosetta, because it can cause problems if you use it sometimes but not other times (for instance, brew will have lots of issues…)

I suppose it’s possible to consider “updating toolchains and software in use to current stable versions” as “insanity” and/or “losing” time, but as a maintainenance-minded person I think it quite the opposite, keeping current fixes bugs (like “it doesn’t work on my M1”) before you even know the bugs existed

Well I tried very very hard to get everything working properly for too many days using RN and my M1, unfortunately besides some really basic apps it was a nightmare, if you have solutions to make M1 + RN + Flipper + FB SDK + Google SDK work properly natively without shady hacks natively I am more than welcome to know.

I also am a man of maintainability wherever I can and that would ease my mind a great deal, and everyone could benefit from this.

@quanghoahcm Have you try opening your project with the .workspace file in the ios folder

Change your iOS version to match with what you have on your podfile

I tried everything This is what worked for me.

problem is with flipper in podfile.

Before podFile : use_flipper!

After : use_flipper!({ ‘Flipper’ => ‘0.74.0’ })

then:

pod install

In my case, if your xcode’s version is above 12

  1. check the ‘Build Settings’ of your project & target, search valid_archs.
  2. if valid_archs configuration item exsits and x86_64 is missing, add x86_64.

After fighting for a while, we can run the app on real device and emulators on xcode 12.2 and ios 14.2, here is how we fix the modulemap issue:

  1. unistall old xcode
  2. install Xcode 12.2 (Release candidate) and command line 12.2 (Release candidate) from apple developer area (make sure the xcode path is from 12.2 and then go to PREFERENCE form xcode 12.2 and select the command line 12.2 you had installed)
  3. Update CocoaPods to 1.10 (supporting Xcode 12)
  4. npm install (npm uses some of xcode 12.2 command line, otherwise it will throw errors or bad installation)
  5. add the arm64 exclude architectures and DELETE VALID_ARCHS more info in this blog
  6. pod install
  7. may be has some failed on emulator becasue of Target issue, we accept the Xcode recomendation and build again and it works.

our workspace uses NEW BUILD SYSTEM (under file->workspace settings menu) as Apple recommends.

Hope it helps 😃

I had this issue on a real device, the OS version installed on the phone was incompatible with Xcode

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

It’s worked for me

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

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.

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)

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.

  • 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

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

Linking that way, as opposed to the automatic way, is only recommended and useful for older versions of React Native. Doing that with the most recent version of RN should either be a no-op or cause the project to be broken from a misconfiguration.

For the uninitiated, linking packages, which is what yarn react-native link does, is different than linking to apps such as a browser.

I run npx react-native run-ios on Vs code and work fine. Then I opened the . xcworkspace file on XCode and it worked too

Thanks, this worked for me ❤️

I was able to solve my problem by synchronizing the xcode development target and pod target version.

Eu tbm com

macOS version: Big Sur 11.2 Xcode version: 12.4 (12D4e)

Mesmo problema

Alem disso não consigo abrir o projeto através do workspace. Da um erro no xcode que pede para ser reiniciado. Neste cenário só estou conseguindo abrir o projeto através do arquivo projeto.xcodeproj que da o erro reportado

I have the same problem. I tried everything but couldn’t figure it out.

My problem is all about getting the archive.

Even when I try to create and archive a project with react-native-init, I get this error.

Help.

macOS version: Big Sur 11.1 Xcode version: 12.4

Screen Shot 2021-01-31 at 22 29 49 Screen Shot 2021-01-31 at 22 30 52

Let me show you. delete all the pod files Leave this alone. config = use_native_modules! use_react_native! (: path => config ["reactNativePath"]) pod install again and it will work well.

This is how it worked for me

  1. Close Xcode

  2. rm -Rf ~/Library/Developer/Xcode/DerivedData

  3. On your Podfile, update platform :ios to platform :ios, '11.0'

  4. yarn && cd ios/ && pod install

  5. Run XCode (open .xcworkspace) again then you will see a warning to upgrade to swift 5, Click the warning then update (This will take some time)

  6. After that run the build again, then the app will run.

If that didn’t work out for you, clean your repo and remove all the untracked files git clean -fdx then do the steps again. Note that git clean -fdx will remove all the untracked files so it’s better to have a backup of all your working changes.

Restarting my computer solved this problem for me

Xcode 12. React Native: 0.63.2, +1

same here on device it works. I am able to build for generic and adhoc but not for simulators

Tried every single solution as well. Nothing worked. Updated everything, cleaned project, restarted mac/iterm/xcode, ran from iTerm and from Xcode and nothing yet.

I was getting this error when using xcodebuild to automate the build process. I found out my failing build command:

xcodebuild clean archive 
  -scheme releaseScheme 
  -configuration Release 
  -archivePath ../builds/<AppName>.xcarchive 
  -allowProvisioningUpdates
  DEVELOPMENT_TEAM=<TeamId> 

was missing -workspace <AppName>.xcworkspace to specify that I was trying to build the workspace and not the project. The complete command that was working for me is below.

xcodebuild clean archive 
  -scheme releaseScheme 
  -configuration Release 
  -archivePath ../builds/<AppName>.xcarchive 
  -allowProvisioningUpdates
  -workspace <AppName>.xcworkspace
  DEVELOPMENT_TEAM=<TeamId> 

The cause for me was that the new scheme I had created was not setup in my Podfile, I needed to add a line:

project 'MyProject', 
  'debug' => :debug,
  'myNewScheme' => :release 

Change the Schema Settings and Product>Scheme>Edit Scheme> Find Implicit Dependencied should be checked. This worked for me…

None of the above worked for me. I had added some new configurations and deleted the default ‘Debug’ configuration from xcode.

So I had to change the following line in Podfile :configuration => ‘Debug’

to :configurations => [‘DevDebug’, ‘QADebug’, ‘StageDebug’, ‘ProdDebug’]

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

Yesterday I run some clean up on my computer. Xcode cache was wiped out, as well as some simulators data etc.

Not quite sure - but today I had similar issue, telling me YogaKit.modulemap is not found in DeriveredData. It was working from xcode, but not from terminal (I’m using fastlane).

The above “solution” did the job but I’m thinking it’s more a workaround than actually fix.

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.

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.