DEV Community

Matt Ruiz
Matt Ruiz

Posted on • Edited on

Firebase: The following Swift pods cannot yet be integrated as static libraries

Hola hola,

I ran into the following error after running npx pod-install while using React Native Firebase(v15.2.0) and React Native v0.69.3:

[!] The following Swift pods cannot yet be integrated as static libraries:

The Swift pod `FirebaseCoreInternal` depends upon `GoogleUtilities`, which does not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.
Enter fullscreen mode Exit fullscreen mode

After adding just pod 'GoogleUtilities', :modular_headers => true the above was solved. Then, I had many similar errors with other RNFirebase modules such as FirebaseStorage, FirebaseFunctions, etc.

As many devs do, I added the first line into Google: The following Swift pods cannot yet be integrated as static libraries: and found answers for non RNFirebase libraries.

I didn't see any react-native-firebase issues so I went to their repo and found this message which leads to a StackOverflow answer.

For me, the above error was solved by adding the following to my Podfile caused there to be no issues for any RNFirebase module:

  pod 'Firebase', :modular_headers => true
  pod 'FirebaseCore', :modular_headers => true
  pod 'FirebaseCoreInternal', :modular_headers => true  
  pod 'FirebaseStorageInternal', :modular_headers => true
  pod 'FirebaseCoreExtension', :modular_headers => true
  pod 'FirebaseAppCheckInterop', :modular_headers => true
  pod 'FirebaseAuthInterop', :modular_headers => true
  pod 'FirebaseMessagingInterop', :modular_headers => true
  pod 'GTMSessionFetcher', :modular_headers => true
  pod 'FirebaseAppCheckInterop', :modular_headers => true
  pod 'FirebaseAuthInterop', :modular_headers => true
  pod 'GoogleUtilities', :modular_headers => true
Enter fullscreen mode Exit fullscreen mode

Hopefully this increases visibility for others.

I've been working with React Native for the last 4 years and will continue documenting common React Native errors that we come across at TroutHouseTech.

-Matt

Top comments (4)

Collapse
 
fawaz441 profile image
Abdulsalam Fawaz Akolade

This is really helpful. Thanks!

Collapse
 
matthewzruiz profile image
Matt Ruiz

Very cool! Thanks for reading

Collapse
 
pharmgarant profile image
pharmgarant

I have the same mistake. But I use Expo. What should I do in this case?

Collapse
 
cherepii profile image
cherepii

did you find any solutions for expo ?