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

yogakit/yogakit.modulemap' not found React Native #29605

Closed
rebekahshaw92 opened this issue Aug 10, 2020 · 124 comments
Closed

yogakit/yogakit.modulemap' not found React Native #29605

rebekahshaw92 opened this issue Aug 10, 2020 · 124 comments
Labels
Needs: Triage 🔍 Resolution: Locked This issue was locked by the bot.

Comments

@rebekahshaw92
Copy link

rebekahshaw92 commented Aug 10, 2020

Description

I create a new app using react native. When I try to run the app within an iOS emulator using Xcode I get the following error and the app doesn't run.

fatal error: module map file '/Users/rebekah/Library/Developer/Xcode/DerivedData/example-feduelzeswwgfqdrghxcxxfxavuz/Build/Products/Debug-iphonesimulator/YogaKit/YogaKit.modulemap' not found

I have tried to google this but have been unable to find a way to fix it, is there any way this can be fixed?

React Native version:

System:
OS: macOS 10.15.6
CPU: (4) x64 Intel(R) Core(TM) i5-5250U CPU @ 1.60GHz
Memory: 23.01 MB / 4.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 13.7.0 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.5 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.9.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 13.6, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
Android SDK:
API Levels: 29
Build Tools: 29.0.2
Android NDK: Not Found
IDEs:
Android Studio: Not Found
Xcode: 11.6/11E708 - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_45 - /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

@maxlxq
Copy link

maxlxq commented Sep 19, 2020

Xcode 12, + 1

@hongmaoxiao
Copy link

Xcode 12, + 1

Maybe u can open xxx.xcworkspace instead of xxx. xcodeproj

@dopplerDistortion
Copy link

Xcode 12, + 1

Having the same issue. working with .xcworkspace there is no issue on real device, release scheme and archive. This issue only persist on debug run simulators

@ykjsw
Copy link

ykjsw commented Sep 20, 2020

Xcode 12, + 1

@walkeknow
Copy link

I had the same issue when I upgraded to Xcode 12. I just deleted podfile.lock in the ios folder and rebuilt the project with cd ios && pod install && cd ... This fixed the issue.

@dopplerDistortion
Copy link

Xcode 12, + 1

Having the same issue. working with .xcworkspace there is no issue on real device, release scheme and archive. This issue only persist on debug run simulators

Quick update downgrading xcode from 12 to 11.7 did the trick. Seems releated with Xcode for me.

@sagittaracc
Copy link

I did everything I mean downgraded Xcode to 11.7, deleted podfile.lock and reinstall it. can't even run on a real device.
this pisses me off

@dopplerDistortion
Copy link

I did everything I mean downgraded Xcode to 11.7, deleted podfile.lock and reinstall it. can't even run on a real device.
this pisses me off

I did suggestions for removing Xcode before installing 11.7 from here https://stackoverflow.com/a/53575585
Then installed Xcode. This might be helpful for your issue

@OctavianRotari
Copy link

This problem might be related to the fact that Xcode 12 is building universal apps which builds the core for more architectures.

I did not figure out yet how to run any other Schema apart from "Debug". To run Debug in "Build Settings" -> "Excluded Architectures" I've added "arm64", however since "Build Active Architecture Only" is set to "yes" for "Debug" and "no" for all the other schemas when I try to build for any other schemas my build fails with: yogakit/yogakit.modulemap not found React Native.

@mayank-budhiraja
Copy link

This problem might be related to the fact that Xcode 12 is building universal apps which builds the core for more architectures.

I did not figure out yet how to run any other Schema apart from "Debug". To run Debug in "Build Settings" -> "Excluded Architectures" I've added "arm64", however since "Build Active Architecture Only" is set to "yes" for "Debug" and "no" for all the other schemas when I try to build for any other schemas my build fails with: yogakit/yogakit.modulemap not found React Native.

Already tried, same results. Build Failed.

@MaisDennis
Copy link

Xcode 12, + 1

Maybe u can open xxx.xcworkspace instead of xxx. xcodeproj

This was the difference maker for me. Plus downgraded version.

@nqdung16
Copy link

Did anyone solve this? I still cannot run on simulator devices but it works fine on the real one. However, real devices do not show my images as well as icons

@vipulswarup
Copy link

I am having the same issue when trying to build for a production release

@whalemare
Copy link

whalemare commented Oct 1, 2020

xcode 12, react-native 0.63.2

Solved issue by change ios target to 11.0 in Podfile and in General xcode tab
https://stackoverflow.com/a/56183691/5662244

@nqdung16
Copy link

nqdung16 commented Oct 4, 2020

xcode 12, react-native 0.63.2

Solved issue by change ios target to 11.0 in Podfile and in General xcode tab
https://stackoverflow.com/a/56183691/5662244

Nah still not working with me. I tried all of the above solutions and nothing works

@Selfmade-RuLeZ
Copy link

I'm currently on Xcode 12.2 beta and there you can just build it out of the box. Had issues too with Xcode 12 from AppStore. If you have a Apple Development Account, I would recommend to download Xcode 12.2 beta until its free for public access, otherwise you should use Xcode 11

@Kaybarax
Copy link

Kaybarax commented Oct 8, 2020

Xcode 12, + 1

Maybe u can open xxx.xcworkspace instead of xxx. xcodeproj

This works for me 👍

@rf1804
Copy link

rf1804 commented Oct 9, 2020

Do check IPHONEOS_DEPLOYMENT_TARGET should be 11.0
This works for me

@sasweb
Copy link

sasweb commented Oct 11, 2020

Neither downgrading Xcode to 11.7 nor upgrading deployment target to 11.0 is a valid solution. Same for arm64 exclusion. These are just hacks which will most likely pop up at some time in a different place.

When I start a new RN (bare) project everything works fine with Xcode 12 and deployment target 10.0 - which is actually suggested in RN diff. Unfortunately I am stuck here after upgrading RN from 61.5 to 63.3. Any other suggestions are welcomed.

Edit: I have always been using xcworkspace

@Kaybarax
Copy link

Neither downgrading Xcode to 11.7 nor upgrading deployment target to 11.0 is a valid solution. Same for arm64 exclusion. These are just hacks which will most likely pop up at some time in a different place.

When I start a new RN (bare) project everything works fine with Xcode 12 and deployment target 10.0 - which is actually suggested in RN diff. Unfortunately I am stuck here after upgrading RN from 61.5 to 63.3. Any other suggestions are welcomed.

#29605 (comment)

@rf1804
Copy link

rf1804 commented Oct 12, 2020

Do check IPHONEOS_DEPLOYMENT_TARGET should be 11.0
This works for me

Open <Project>/ios/<Project Name>.xcodeproj/project.pbxproj in any IDE and search for IPHONEOS_DEPLOYMENT_TARGET there will be 2 of them and both should be at-least 11.0

In my every project this worked.

@kofsiwon
Copy link

but react-native upgrade helper's Podfile

contains [platform :ios, '10.0']

@sasweb
Copy link

sasweb commented Oct 12, 2020

Do check IPHONEOS_DEPLOYMENT_TARGET should be 11.0
This works for me

Open <Project>/ios/<Project Name>.xcodeproj/project.pbxproj in any IDE and search for IPHONEOS_DEPLOYMENT_TARGET there will be 2 of them and both should be at-least 11.0

In my every project this worked.

Most likely it worked for you because you had different versions in your Podfile and your project settings. However, this general issue is not related to iOS 11 as a deployment target. As @kofsiwon mentioned, official docs contain iOS 10 as minimum target.

@huynguyen3tiki
Copy link

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.

@OctavianRotari
Copy link

OctavianRotari commented Oct 15, 2020

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

@nqdung16
Copy link

None of them work

@qapasaskhat
Copy link

cd ios
pod deintegrate
pod install

@nkigen
Copy link

nkigen commented Apr 5, 2021

Turns out mine was a version mismatch between podfile and xcode. https://stackoverflow.com/a/66788848/1834127

@raaidkh-tsa
Copy link

Just run
cd ios && pod install

@oguzhanoptimum7
Copy link

May be worth mentioning -- as @JoeyAlpha5 said you need to add arm64 to Excluded Architectures in project AND Pods build settings, but here's what got me (seems kinda funny now): I didn't realize that when you run pod install the Pods build settings get reset back to their default values. So I spent about a day going down a rabbit hole when really I could have just double checked the Pods build settings :|

worked for me!
Ekran Resmi 2021-04-18 19 47 08

@TadeoZamora
Copy link

Screenshot 2021-02-01 at 13 20 51

I faced the same issue after upgrading to an m1 MacBook pro, adding the following to the pods build setting and project build setting solved it for me.

This works for me!. but not just adding arm64 in Pods file you need to replicate the same inside the project file.

@code-anas
Copy link

code-anas commented Apr 23, 2021

"react-native": "0.64.0"

in Info.plist change armv7 to armv64

<key>UIRequiredDeviceCapabilities</key>
<array>
  <string>armv64</string>
</array>

@ahayman
Copy link

ahayman commented Apr 30, 2021

TLDR: I removed all references to YogaKit.modulemap from build settings, but left all references to Yoga.modulemap in place.

Okay, I've had this problem since upgrading to .63/.64. This problem seems to have multiple issues, but I've not seen the solution that worked for me (I tried all listed here). However, @feuzeu ranted about the difference between Yoga.modulemap and YogaKit.modulemap, and that got me searching.

Old builds did have a YogaKit folder under the DerivedData/.../Build/Products/ folder. Newer builds did not. A brief search through the build settings revealed that YogaKit was only mentioned in OTHER_SWIFT_FLAGS, whereas Yoga (without the 'Kit') is mentioned in multiple places. So I removed the Yogakit reference and I can now build and run without any issues.

-Xcc -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/YogaKit/YogaKit.modulemap"

My suspicion is YogaKit was renamed/replaced/migrated/whatever to simply Yoga when upgrading. It seems build settings were upgraded in all places except OTHER_SWIFT_FLAGS.

Hope this helps anyone else having this problem.

@tsirolnik
Copy link

I've opened the project with xed -b ios instead of opening it via xcode and it worked properly

@kbwo
Copy link

kbwo commented Jun 4, 2021

I'm using m1 macbook air.
In my case, these solutions are not working when running the "react native run-ios" command, but after a successful build by pressing the play icon in xcode, the "react native run-ios" command is now successful.

@ravindranpandu
Copy link

Screenshot 2021-02-01 at 13 20 51 I faced the same issue after upgrading to an m1 MacBook pro, adding the following to the pods build setting and project build setting solved it for me.

This works for me!. but not just adding arm64 in Pods file you need to replicate the same inside the project file.

I am on M1 Macbook pro and this seems my problem and this helped me to resolve the issue, thanks

@cristiandan
Copy link

IF YOU'RE ON M1 CHIP ONLY
after spending hours on different github issues and reading everything, got lucky and managed to find a way to make it work.
what I did:

  1. clone the project in a different folder from scratch (it's important that the folder path is different because xcode caches build details)
  2. set terminal (iterm in my case) to run with rosetta, (I have cocoapods installed with rosetta)
  3. set xcode to run with rosetta
  4. yarn install all packages and pod install all pods from the rosetta terminal
  5. run the project from the rosetta terminal

@samrezikram
Copy link

samrezikram commented Jun 15, 2021

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


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

enter image description here

@JimTeva
Copy link

JimTeva commented Jun 23, 2021

Thank you @rf1804 it worked for me!

Solution:
In Xcode, search for IPHONEOS_DEPLOYMENT_TARGET
All of them for your project (and targets) should be at least 11.0

@aiba
Copy link

aiba commented Jun 27, 2021

For those coming to this issue trying to get react-native to run on Apple Silicon (M1) hardware, you may be interested in the steps I took to get this to work:

https://github.com/aiba/react-native-m1/blob/main/README.md

@Arcaneless
Copy link

Arcaneless commented Jun 29, 2021

TLDR: I removed all references to YogaKit.modulemap from build settings, but left all references to Yoga.modulemap in place.

Okay, I've had this problem since upgrading to .63/.64. This problem seems to have multiple issues, but I've not seen the solution that worked for me (I tried all listed here). However, @feuzeu ranted about the difference between Yoga.modulemap and YogaKit.modulemap, and that got me searching.

Old builds did have a YogaKit folder under the DerivedData/.../Build/Products/ folder. Newer builds did not. A brief search through the build settings revealed that YogaKit was only mentioned in OTHER_SWIFT_FLAGS, whereas Yoga (without the 'Kit') is mentioned in multiple places. So I removed the Yogakit reference and I can now build and run without any issues.

-Xcc -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/YogaKit/YogaKit.modulemap"

My suspicion is YogaKit was renamed/replaced/migrated/whatever to simply Yoga when upgrading. It seems build settings were upgraded in all places except OTHER_SWIFT_FLAGS.

Hope this helps anyone else having this problem.

This actually helped me after upgrading to 0.64.1

@jinhale
Copy link

jinhale commented Jul 6, 2021

Xcode 12, + 1

Maybe u can open xxx.xcworkspace instead of xxx. xcodeproj

This was the difference maker for me. Plus downgraded version.

Did you downgrade Xcode, React Native, or something else?

@jinhale
Copy link

jinhale commented Jul 6, 2021

YogaKit/YogaKit.modulemap

Can you give more information? Are you just searching for "YogaKit.modulemap" then commenting out every line that matches? I'm not sure what command takes -Xcc as a flag.

@timothyerwin
Copy link

I had this happen when I renamed my project...basically the scheme was still using the old one...I think xcode stores that outside the project so I had to create a new scheme with the same name I renamed to and then it worked. I also used the workspace.

I was able to find the exact error in react native by running the xcodebuild command manually.

@waclock
Copy link

waclock commented Jul 25, 2021

Using workspace works for me, however I cannot run the project by running react-native run-ios which is a bit annoying

@sanketkheni01
Copy link

sanketkheni01 commented Aug 3, 2021

very simple solution just set in terminal and Xcode and try again... using a new react native project
Screen Shot 2021-08-03 at 8 48 44 PM

@Apatoallo
Copy link

Apatoallo commented Aug 17, 2021

Xcode 12, + 1

Maybe u can open xxx.xcworkspace instead of xxx. xcodeproj

I need to get a build from xcproj facing this issue when Product -> Archieve

@Andriiklymiuk
Copy link

Andriiklymiuk commented Aug 19, 2021

having the same issue on NOT m1 macbook on react native 0.65.
No solution works.
Have anyone fixed it there ?

This is my podfile post install

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"
        config.build_settings["ONLY_ACTIVE_ARCH"] = "YES"
      end
      case target.name
      when 'RCT-Folly'
        target.build_configurations.each do |config|
          config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
        end
      end
    end
  end

@prathamnemade
Copy link

#29605 (comment) - This worked for me.

@diregraph
Copy link

Xcode 12, + 1

Maybe u can open xxx.xcworkspace instead of xxx. xcodeproj

This works. As stated in the docs, if you're using Cocoa pods, .xcworkspace should be used.

@AndreyPatseiko
Copy link

AndreyPatseiko commented Sep 16, 2021

xcode 12, react-native 0.63.2

Solved issue by change ios target to 11.0 in Podfile and in General xcode tab
https://stackoverflow.com/a/56183691/5662244

image
Work for me! xcode 12.3, react-native 0.65.1

@facebook facebook locked as resolved and limited conversation to collaborators Oct 1, 2021
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Needs: Triage 🔍 Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests