You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Podfile doesn't support use_modular_headers! directive, get an error at build time
Steps to reproduce
create a sample react native project npx react-native init MyApp
add use_modular_headers! to the Podfile
do pod install
Getting error as Redefinition of module 'ReactCommon' error in Xcode project when building
(Xcode error)
React-RCTAppDelegate
/Users/jay/tmp/rn74/MyApp/ios/Pods/Headers/Public/ReactCommon/ReactCommon.modulemap
/Users/jay/tmp/rn74/MyApp/ios/Pods/Headers/Public/ReactCommon/ReactCommon.modulemap:1:8 Redefinition of module 'ReactCommon'
Previously defined here
Despite the fact two other issues are closed, the workarounds provided there do not work because enabling modular_headers per dependency is not always an option that can be concidered.
As a workaround try to remove use_modular_headers! from your Podfile and apply modular headers only to specific pods
In my case I needed to use modular headers for firebase related pods
pod 'FirebaseCore', :modular_headers => true
pod 'Firebase', :modular_headers => true
pod 'FirebaseCoreInternal', :modular_headers => true
pod 'GoogleUtilities', :modular_headers => true
As a workaround try to remove use_modular_headers! from your Podfile and apply modular headers only to specific pods
In my case I needed to use modular headers for firebase related pods
worked for me
We did the same thing and that solved the issue with firebase, but we have another third-party package that is not accepting :modular_headers. So I thought it might be good just to open a general ticket on the subject.
Description
Podfile doesn't support
use_modular_headers!
directive, get an error at build timeSteps to reproduce
create a sample react native project
npx react-native init MyApp
add
use_modular_headers!
to the Podfiledo
pod install
Getting error as Redefinition of module 'ReactCommon' error in Xcode project when building
React Native Version
0.74.2
Affected Platforms
Build - MacOS
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://github.com/jkoutavas/RN-0-74-2-example
Screenshots and Videos
There's also a reference to this issue on stack overflow: https://stackoverflow.com/questions/78540513/react-native-pod-file-use-modular-headers-throwing-redefinition-of-module-reac/78630743#78630743
The text was updated successfully, but these errors were encountered: