1
  • I have created a sample react native project npx react-native init MyNewProject
  • I added pod dependency in ios pod file
  • I added use_modular_headers!
  • Getting error as Redefinition of module 'ReactCommon' error in xcode project
  • in vs code getting below error

enter image description here

target 'MyNewProject' do
  config = use_native_modules!
  

  use_react_native!(
    :path => config[:reactNativePath],
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )
  pod 'some pod'

  target 'MyNewProjectTests' do
    inherit! :complete
    # Pods for testing
  end

I tried pod uninstall and install

2
  • Please post the an error as text, not a screenshot. Commented May 27, 2024 at 19:41
  • I opened a bug report for this: github.com/facebook/react-native/issues/45000 Commented Jun 17, 2024 at 16:49

2 Answers 2

0

I had the same issue with other pods (Firebase). I assume the issue has to do with recursive dependecnies that are also imported explicitly. I tried all the same things as you did, although the only thing that helped me was to close xcode, run

pod deintegrate
pod install

and rebuild.

In you have installed firebase recently, try this:

pod 'FirebaseCore', :modular_headers => true
pod 'Firebase', :modular_headers => true
pod 'FirebaseCoreInternal', :modular_headers => true
pod 'GoogleUtilities', :modular_headers => true
Sign up to request clarification or add additional context in comments.

Comments

0

For anyone tries to develop react native with expo first time after me:

1 Comment

While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.