---
title: iOS SPM Support
description: Resolve Firebase iOS SDK dependencies with Swift Package Manager (required for Firebase Apple SDK 13+).
next: /faqs-and-tips
previous: /platforms
---

# iOS SPM Support

React Native Firebase resolves its Firebase Apple SDK dependencies with
[Swift Package Manager (SPM)](https://www.swift.org/package-manager/).
This changes only how the native Firebase SDK is installed; your JavaScript and
native application code do not change.

Firebase Apple SDK **13.0.0 and later are no longer distributed through
CocoaPods**. The last CocoaPods release is **12.19.0**. See Google's
[CocoaPods deprecation guide](https://firebase.google.com/docs/ios/cocoapods-deprecation).

## Requirements and defaults

- React Native **0.75 or newer** is required (`spm_dependency`).
- SPM is the only supported Firebase install path for this major.
- `$RNFirebaseDisableSPM = true` and Expo `ios.disableSPM: true` **fail**
  `pod install` / prebuild — they do not install CocoaPods Firebase 13 pods.
- SPM requires CocoaPods 1.10 or newer for the React Native pod integration.
  React Native 0.75+ templates already satisfy this requirement.
- SPM pins the Firebase iOS SDK to the exact version in
  `sdkVersions.ios.firebase` in `@react-native-firebase/app` (currently **13.0.0**).

SPM requires dynamic framework linkage:

```ruby
use_frameworks! :linkage => :dynamic
```

Do not use RNFB's SPM mode with `use_frameworks! :linkage => :static`.
A Podfile with no `use_frameworks!` line (or `use_frameworks! false`) is static
linkage too — that is the stock React Native / bare Expo default.
firebase-ios-sdk SPM products are automatic libraries (plain `.library(...)`,
not `type: .dynamic`), so each pod that depends on them embeds its own copy.
With static pod linkage those copies collide at link time as duplicate-symbol
errors. `pod install` fails fast for that combination instead of surfacing the
linker failure later. Dynamic linkage is required for SPM mode to build and
run; see [Sharing FirebaseCore with other native pods](#sharing-firebasecore-with-other-native-pods)
for what dynamic linkage does and does not give you.

## Google Sign-In caveat

Firebase Apple SDK **13** depends on App Check **12**. GoogleSignIn and
Firebase 13 in the same app can fail App Check resolution until GoogleSignIn
(and any React Native wrapper that pins it) allow App Check 12. The SPM and
CocoaPods paths are separate:

- **SPM:** Tagged GoogleSignIn **10.0.0** still declares App Check
  `from: "11.0.0"` (11.x). [google/GoogleSignIn-iOS #626](https://github.com/google/GoogleSignIn-iOS/pull/626)
  (merged on main) widens the **SPM** App Check range to
  `11.0.0 ..< 13.0.0`. That change is **not in a tagged release yet**. An
  SPM resolve can succeed only after a GoogleSignIn tag that includes #626
  (or an equivalent App Check 12-capable SPM range).
- **CocoaPods:** The GoogleSignIn podspec on main and in **10.0.0** still
  declares `AppCheckCore ~> 11.0`. #626 did **not** change the CocoaPods
  dependency. CocoaPods graphs that pull GoogleSignIn alongside Firebase 13
  stay blocked until a **podspec** bump allows App Check 12 and
  `@react-native-google-signin/google-signin` (or your Podfile pin) picks up
  that release.

Track GoogleSignIn-iOS releases and the React Native Google Sign-In package
for both paths. SPM progress alone does not unblock CocoaPods consumers.

## Expo projects

Expo projects must select dynamic linkage with
[`expo-build-properties`](https://docs.expo.dev/versions/latest/sdk/build-properties/):

```json
{
  "expo": {
    "plugins": [
      [
        "expo-build-properties",
        {
          "ios": {
            "useFrameworks": "dynamic"
          }
        }
      ]
    ]
  }
}
```

Do **not** pass `disableSPM: true` to the `@react-native-firebase/app` config
plugin — Firebase 13+ is SPM-only and that option fails prebuild.

The sections below describe editing `ios/Podfile` directly for React Native
CLI projects. Do not follow Podfile edits in an Expo project -- Expo
regenerates `ios/Podfile` from your config plugins on every prebuild. Use
`expo-build-properties` instead, as shown above.

## Use SPM (React Native CLI)

For React Native 0.75 or newer, SPM is selected automatically. Configure dynamic
linkage in your `ios/Podfile`, then install pods normally:

```ruby
use_frameworks! :linkage => :dynamic
```

```bash
cd ios
pod install
```

The install output identifies the selected mode:

```text
[react-native-firebase] RNFBApp: Using SPM for Firebase dependency resolution (products: FirebaseCore, FirebaseInstallations)
```

RNFB also adds an `[RNFB] Embed Firebase SPM Frameworks` build phase to the app
target. This phase embeds Firebase frameworks built by SPM that React Native's
pod-level SPM integration does not otherwise copy into the app bundle.

### Release build and module-resolution settings

RNFB automatically applies two build settings needed for SPM + dynamic
linkage, on every `pod install`/`pod update`:

- `-ObjC` in the app target's linker flags and on RNFB pod targets, so
  Release's dead-code stripping does not drop Firebase's
  `FIRLibrary`/`FIRComponent` registration or Measurement Objective-C
  categories statically absorbed into `RNFBAnalytics`.
- `SWIFT_ENABLE_EXPLICIT_MODULES = 'NO'` and `CLANG_ENABLE_EXPLICIT_MODULES =
'NO'` on both the app project and the Pods project, so Xcode 26's explicit
  Swift and Clang modules don't fail to resolve Firebase's internal-only SPM
  targets (`FirebaseCoreInternal`, `FirebaseSharedSwift`) or `@import`s of
  Firebase modules in your own Objective-C/Objective-C++ files. This does not
  disable SPM -- it makes Swift and Clang use implicit module discovery
  across the app, CocoaPods, and SPM build boundary.

You do not need to configure either of these yourself. If `pod install` warns
that they could not be applied automatically, or if Xcode still reports that a
Firebase module cannot be resolved, add the fallback in your existing
`post_install` block, after `react_native_post_install`:

```ruby
post_install do |installer|
  react_native_post_install(
    installer,
    config[:reactNativePath],
    # your existing options
  )

  rnfirebase_apply_spm_build_settings(installer)
end
```

### Framework-embedding fallback

RNFB normally installs its SPM framework-embedding phase automatically after
CocoaPods has integrated `[CP] Embed Pods Frameworks` into the app target
(`post_integrate`). If `pod install` warns that automatic embedding could not
be configured, call the documented fallback from `post_integrate`:

```ruby
post_integrate do |installer|
  rnfirebase_add_spm_embed_phase(installer)
end
```

Do not add the fallback unless the warning appears or the generated app target
does not contain `[RNFB] Embed Firebase SPM Frameworks`.

## Sharing FirebaseCore with other native pods

React Native attaches SPM products to each pod target via `spm_dependency`.
Because firebase-ios-sdk products are automatic libraries, each dynamic pod
framework that depends on Firebase embeds its own copy of `FirebaseCore`.
`FirebaseApp.configure()` in the app configures only the copy that target
links. Another pod's copy is never configured, so `FirebaseApp.app()` can
return `nil` there (and Auth can silently look signed-out even when RNFB JS
Auth has a user).

| RNFB | Other native dependency | Shared FirebaseCore?                     |
| ---- | ----------------------- | ---------------------------------------- |
| SPM  | SPM (`spm_dependency`)  | No: each dynamic pod embeds its own copy |
| SPM  | CocoaPods Firebase pods | No: dual resolution                      |

CocoaPods Firebase is no longer available for Firebase 13+. If a third-party
native module must share one configured `FirebaseApp` with RNFB, that module
must also resolve Firebase via SPM (same exact SDK version), not CocoaPods
trunk. Do not mix RNFB SPM with a third-party pod that still pulls Firebase
via CocoaPods — that is dual resolution and does not produce one shared
runtime.

Static pod linkage is not a sharing workaround under SPM: it fails at link
time with duplicate symbols (and `pod install` rejects the combination).

## Troubleshooting

- **`pod install` fails with "Firebase Apple SDK is no longer distributed through CocoaPods":**
  Remove `$RNFirebaseDisableSPM = true` and Expo `ios.disableSPM`. Use
  `use_frameworks! :linkage => :dynamic` and React Native 0.75+.
- **`pod install` fails with "SPM + static linkage is not supported":** Use
  dynamic linkage (`use_frameworks! :linkage => :dynamic`). A Podfile with no
  `use_frameworks!` line (or `use_frameworks! false`), the stock React Native /
  Expo default, is static linkage too.
  - With the stock template Podfile, `USE_FRAMEWORKS=dynamic pod install` also
    works, but it must be set for every `pod install` (including CI); the
    Podfile line is the durable fix.
  - Expo: set `ios.useFrameworks` to `"dynamic"` in the `expo-build-properties`
    plugin (see [Expo projects](#expo-projects)), then re-run
    `npx expo prebuild`. Only if you maintain `ios/` by hand (no prebuild), set
    `"ios.useFrameworks": "dynamic"` in `ios/Podfile.properties.json` instead.
- **`FirebaseApp.app()` is `nil` / Auth looks signed-out inside another native
  pod, or runtime logs duplicate `FIRApp` classes:** SPM mode cannot share one
  `FirebaseCore` across dynamic pod frameworks. See
  [Sharing FirebaseCore with other native pods](#sharing-firebasecore-with-other-native-pods).
- **Google Sign-In / App Check SPM resolve failures:** See
  [Google Sign-In caveat](#google-sign-in-caveat).
- **`FirebaseCoreInternal`/`FirebaseSharedSwift` cannot be resolved, or a
  Release/Archive build crashes at launch with a missing Firebase symbol:**
  RNFB applies `-ObjC`, `SWIFT_ENABLE_EXPLICIT_MODULES = 'NO'`, and
  `CLANG_ENABLE_EXPLICIT_MODULES = 'NO'` automatically; call
  `rnfirebase_apply_spm_build_settings(installer)` as a fallback only if
  `pod install` warns it could not do so.
- **A Firebase framework is missing at app launch:** Re-run `pod install`, check
  for its automatic-embedding warning, and confirm the app target contains
  `[RNFB] Embed Firebase SPM Frameworks`. Use the fallback only when needed.
- **`spm_dependency` is unavailable:** Upgrade to React Native 0.75 or newer.
- **SPM and CocoaPods both produce the same Firebase framework:** Remove manually
  declared Firebase pods/packages so RNFB owns Firebase dependency resolution.
- **Release archive fails with an `xcframework-ios.signature` "couldn't be
  copied ... because an item with the same name already exists" error:** a
  long-standing Xcode Archive bug with SPM binary xcframeworks, not an RNFB
  regression. RNFB works around it automatically; if the warning says it could
  not do so, add a Run Script build phase to your app target that removes the
  colliding `.signature` file named in the error.
