question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

error: redefinition of module 'YogaKit' build Failed

See original GitHub issue

Description

npx react-native run-ios

/Users/manas/Documents/projects/rn/helloapp/ios/Pods/Headers/Public/yoga/Yoga.modulemap:1:8: error: redefinition of module 'yoga'
module yoga {
       ^
/Users/manas/Documents/projects/rn/tunga/ios/Pods/Headers/Public/yoga/Yoga.modulemap:1:8: note: previously defined here
module yoga {
       ^
/Users/manas/Documents/projects/rn/helloapp/ios/Pods/Headers/Public/YogaKit/YogaKit.modulemap:1:8: error: redefinition of module 'YogaKit'
module YogaKit {
       ^
/Users/manas/Library/Developer/Xcode/DerivedData/tunga-ekvukfgeyeqjkfeirvczaszrptkv/Build/Products/Debug-iphonesimulator/YogaKit/YogaKit.modulemap:1:8: note: previously defined here
module YogaKit {
       ^
/Users/manas/Documents/projects/rn/helloapp/ios/Pods/Headers/Public/yoga/Yoga.modulemap:1:8: error: redefinition of module 'yoga'
module yoga {
       ^
/Users/manas/Documents/projects/rn/tunga/ios/Pods/Headers/Public/yoga/Yoga.modulemap:1:8: note: previously defined here
module yoga {
       ^
/Users/manas/Documents/projects/rn/helloapp/ios/Pods/Headers/Public/YogaKit/YogaKit.modulemap:1:8: error: redefinition of module 'YogaKit'
module YogaKit {
       ^
/Users/manas/Library/Developer/Xcode/DerivedData/tunga-ekvukfgeyeqjkfeirvczaszrptkv/Build/Products/Debug-iphonesimulator/YogaKit/YogaKit.modulemap:1:8: note: previously defined here
module YogaKit {
       ^
<unknown>:0: error: could not build Objective-C module 'SwiftShims'
** BUILD FAILED **


The following build commands failed:
        CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
        CompileSwift normal x86_64 /Users/manas/Documents/projects/rn/helloapp/ios/Pods/YogaKit/YogaKit/Source/YGLayoutExtensions.swift
(2 failures)

Version

0.66.4

Output of npx react-native info

System: OS: macOS 11.5.1 CPU: (4) x64 Intel® Core™ i5-7500 CPU @ 3.40GHz Memory: 176.96 MB / 24.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 16.0.0 - /usr/local/bin/node Yarn: 1.22.15 - /usr/local/bin/yarn npm: 7.10.0 - /usr/local/bin/npm Watchman: 2021.10.11.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.2 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2 Android SDK: API Levels: 29, 30 Build Tools: 29.0.2, 30.0.2, 30.0.3 System Images: android-29 | Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom, android-30 | Google APIs Intel x86 Atom Android NDK: Not Found IDEs: Android Studio: 2020.3 AI-203.7717.56.2031.7935034 Xcode: 12.4/12D4e - /usr/bin/xcodebuild Languages: Java: 1.8.0_292 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 17.0.2 => 17.0.2 react-native: 0.66.4 => 0.66.4 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

Steps to reproduce

npx react-native run-ios

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

No response

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:13

github_iconTop GitHub Comments

7reactions
ste7encommented, Jan 28, 2022

I’m having the same problem via CLI, but builds from Xcode work correctly

6reactions
ste7encommented, Jan 28, 2022

Simply solved by rebooting my Mac. MacBookPro M1, 2020 react-native (0.66.3) Yoga (1.14.0) YogaKit (1.18.1)

Read more comments on GitHub >

github_iconTop Results From Across the Web

react native run-ios redefinition of module 'YogaKit'
When running react-native run-ios in XCode 15, error shows up as follows:
Read more >
redefinition of module with Xcode … | Apple Developer Forums
You're running into this issue because the author of the framework has moved the modulemap file and your carthage directory has not been...
Read more >
Redefinition of module issue - Using Swift
The redefinition of module error is due to swift including both Xcode and CommandLineTools at the same time. This is visible by generating...
Read more >
YogaKit ModuleMap Missing : r/reactnative - Reddit
YogaKit ModuleMap Missing ... fatal error: module map file ... I suspect it might be a bad npm package update, but I failed...
Read more >
Having trouble building an app with fastlane - CircleCI Discuss
I'm having trouble building an iOS app on CircleCi with fastlane. ... /usr/include/libxml2/module.modulemap:1:8: redefinition of module ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found