React-native: yogakit/yogakit.modulemap' not found React Native

Created on 10 Aug 2020  ·  43Comments  ·  Source: facebook/react-native

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

Needs

Most helpful comment

Xcode 12, + 1

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

All 43 comments

Xcode 12, + 1

Xcode 12, + 1

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

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

Xcode 12, + 1

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.

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.

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

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.

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.

Xcode 12, + 1

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

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

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

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

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

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

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

Xcode 12, + 1

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

This works for me 👍

Do check IPHONEOS_DEPLOYMENT_TARGET should be 11.0
This works for me

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

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.

https://github.com/facebook/react-native/issues/29605#issuecomment-705418622

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.

but react-native upgrade helper's Podfile

contains [platform :ios, '10.0']

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.

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.

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

None of them work

cd ios
pod deintegrate
pod install

cd ios
pod deintegrate
pod install

You should try to explain does it work or not

cd ios
pod deintegrate
pod install

Still not working

I solved the error by disabling the flipper like this.
# use_flipper!
# post_install do |installer|
# flipper_post_install(installer)
# end

In my case, I don't know about flipper and don't need it

cd ios
pod deintegrate
pod install

No luck for me either

I'm using xcode 12.1 (12A7403) and ios 14.1 simulator, ios deployment target is 9.0 with the legacy build system
I don't remember exactly what I did so let's try around

  1. Pod update & pod repo update
  2. Add this to your Podfile
    if target.name.start_with?('Flipper') target.build_configurations.each do |config| config.build_settings['VALID_ARCHS'] = 'arm64 arm64e armv7 armv7s x86_64' end end
  3. Clean project and run pod install
  4. Rebuild

I had such a statement in my podfile where i've forgotten to remove the last comma, therefore receiving same error. I removed last comma and everything continued smoothly
project 'dadhesab', 'Sibapp.Debug' => :debug, 'Sibapp.Release' => :release,

As of Xcode 12.1, this issue only seen on real device and solved by changing iOS deployment target in Xcode(general tab) to match the pod file (11.0).

Screen Shot 2563-11-07 at 06 43 21

Screen Shot 2563-11-07 at 06 47 38

I changed the iOS version on the pod file to match with xcode project's. But it's still the same error.

I am also facing the same error can anyone help, please.

I also have a similar error, it works good on Debug build, but fail on Release build.
And finally solved by removing some dependencies related to Flipper for release build setting

My Case

  • Upgrade react-native from 0.61.5 to 0.63.3
  • OS target change from 9.0 to 10.0
  • Update Podfile referenced by react-native 0.63.3 template
  • Apply Flipper code to Appdelegate.m also referenced by react-native 0.63.3 template
  • Other setting follow react-native upgrade helper instruction

At first, I found Flipper is built in Release App, which increase App size by a lot,
then i create another Podfile without Flipper setting for Release.

#NO NEED FOR RELEASE BUILD
#use_flipper!
#post_install do |installer|
#    flipper_post_install(installer)        
#end

But No luck with error message

ld: library not found for -lYogaKit
clang: error: linker command failed with exit code 1 (use -v to see invocation)

After some try-and-error i found there are some dependencies installed by Flipper

CoCoaLibEvent
Filpper
Flipper-DoubleConversion
Flipper-Folly
Flipper-Glog
Flipper-PeerTalk
Flipper-RSocket
Flipperkit
OpenSSL-Universal
Yogakit

So i checked Header Search Paths and Other Linker Flags and found there are some possible Flipper dependencies setting on Release Setting

For Header Search Paths

"${PODS_ROOT}/Headers/Public/Flipper"
"${PODS_ROOT}/Headers/Public/Flipper-DoubleConversion"
"${PODS_ROOT}/Headers/Public/Flipper-Folly"
"${PODS_ROOT}/Headers/Public/Flipper-Glog"
"${PODS_ROOT}/Headers/Public/Flipper-PeerTalk"
"${PODS_ROOT}/Headers/Public/Flipper-RSocket"
"${PODS_ROOT}/Headers/Public/FlipperKit"
"${PODS_ROOT}/Headers/Public/OpenSSL-Universal"
"${PODS_ROOT}/Headers/Public/YogaKit"

For Other Linker Flags

"-l\"YogaKit\"",
"-l\"crypto\"",
"-l\"event\"",
"-l\"event_core\"",
"-l\"event_extra\"",
"-l\"event_pthreads\"",
"-l\"ssl\"",

"\"AudioToolbox\"",
"-framework",

By removing them, my release build success and works fine.
Hope this info can help.

Xcode 12, + 1

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

I've seen a few people mention this.. but I'm not sure what you mean? When I open the xcworkspace project, I'm not able to archive or create a build. Are you using command line to build or the Xcode GUI?

Thanks for your assistance. This is an annoying issue I'm happy to get past!

Xcode 12, + 1

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

I've seen a few people mention this.. but I'm not sure what you mean? When I open the xcworkspace project, I'm not able to archive or create a build. Are you using command line to build or the Xcode GUI?

Thanks for your assistance. This is an annoying issue I'm happy to get past!

When opening your project using xcode, use the .workspace file in your folder, not the .xcodeproj one. This solved the issue for me.

There are some who think that using a workspace is the solution to the problem. They do not know the cause of the problem in the first place. The project will work well in debug, but when it tries to extract the release, it will not be able to do anything

Tried everything in this thread and nothing worked. When I finally removed Flipper and reinstalled pods the yogakit issue was gone, naturally, but I got the same modulemap not found error for another dependency.

This answer from a CocoaPods issue saved me: https://github.com/CocoaPods/CocoaPods/issues/10059#issuecomment-695876995!

add x86_64 to VALID_ARCHS if need to run app on simulator, e.g., x86_64 arm64 arm64e

The app is now running fine (in Debug mode on a simulator, haven't investigated further yet), even for iOS deployment target 10.0. Don't know if this will help those of you with Release build issues – but hope it will be useful to some!

Xcode 12, + 1

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

Its working thanks

Xcode 12, + 1

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

THIS AND

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.

THIS.

Do those two things in a fresh RN63 project and might help like it did for me

Was this page helpful?
0 / 5 - 0 ratings