Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native can't build ios after upgrading to 0.74.1. Redefinition of module 'ReactCommon'

Tags:

react-native

I've followed the upgrade helper to a tee. Then I upgrade other dependencies to the latest versions. Next running pod install, that had a few glitches that I fix by removing Pods folder and the lockfile, and added use_modular_headers! to Podfile for some reason Firebase pod won't install without it. Then when I built for iOS, I got this error...

/Users/marko/App/Livestream/ios/Pods/Headers/Public/ReactCommon/ReactCommon.modulemap:1:8: error: redefinition of module 'ReactCommon'
module ReactCommon {
       ^
/Users/marko/App/Livestream/ios/Pods/Headers/Public/ReactCommon/React-RuntimeApple.modulemap:1:8: note: previously defined here
module ReactCommon {
       ^
1 error generated.

I was expecting the upgrade was much simpler... can I just rename one of the ReactCommon?

like image 666
marko Avatar asked Dec 29 '25 00:12

marko


1 Answers

Okay, I've fixed it. Slowly comparing with a new project.

I believe the issue is with use_modular_headers!. However, Firebase isn't happy without it, pod install won't go through... so I tried manually adding Firebase pod in the project Podfile, so it's like this:

#remove global `use_modular_headers`
#use_modular_headers!

target 'Livestream' do
  config = use_native_modules!

  # add indvidual modular_headers => true as shown in
  # "...depends upon..." pod install error message:

  pod 'FirebaseCore', :modular_headers => true;
  pod 'GoogleUtilities', :modular_headers => true;

Now everyone's happy. Hopefully this helps you guys as well.

like image 113
marko Avatar answered Dec 30 '25 22:12

marko



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!