skip to Main Content

We recently integrated Firebase into our React Native Expo project, but now our build pipelines are failing during the CocoaPods installation step.

The error we’re encountering is:

[!] 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.

To address this issue, we updated our app.json to include the following configuration:

{
  "expo": {
    "plugins": [
      [
        "expo-build-properties",
        {
          "ios": {
            "useFrameworks": "static"
          }
        }
      ]
    ]
  }
}

This works perfectly on local builds, but when running the build on our Azure pipeline, it fails with the same CocoaPods error.

We also tried adding these to our pod file but it does not seem to have any affect

  pod 'Firebase/Analytics'
  pod 'Firebase/Auth'
  pod 'Firebase/Messaging'
  pod 'GoogleUtilities', :modular_headers => true

Has anyone faced a similar issue, or does anyone have suggestions on how to resolve this for CI pipelines?

Any help would be greatly appreciated!

2

Answers


  1. Chosen as BEST ANSWER

    The root cause of the issue was an incorrect specification of the googleServicesFile in the app.json within our Azure environment. The error message we encountered was somewhat misleading and didn’t accurately reflect the actual problem.

    Here’s the relevant configuration:

    "ios": {
      "googleServicesFile": "./GoogleService-Info.plist"
    }
    

  2. Recent versions of Firebase require Podfiles to include use_frameworks! or use_frameworks! :linkage => :static https://firebase.google.com/support/release-notes/ios#version_900_-_may_3_2022

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search