[] SPM + dynamic frameworks (Expo SDK 57): GoogleUtilities classes duplicated in RNFBAnalytics / RNFBMessaging

Author: LorenzHiCreated Sep 15, 2026Updated Sep 16, 2026
Labelstype: bugplatform: iosplugin: messagingplugin: analyticsplatform: expo

Issue

With SPM mode and ios.useFrameworks: "dynamic" (Expo SDK 57), the app builds and launches, but the Objective‑C runtime reports duplicate classes at startup: several GoogleUtilities classes are implemented both in the SPM package‑product framework and statically inside RNFBAnalytics.framework (and, for Reachability, also inside RNFBMessaging.framework).

FIRApp is not duplicated (so the FirebaseCore part of #9140 looks fixed), but GoogleUtilities pulled in via FirebaseAnalytics/FirebaseMessaging still seems to be linked statically into the RNFB pod frameworks. We observed no crash in a short smoke run, but the runtime warns about "spurious casting failures and mysterious crashes".

Console (excerpt)

Class GULNetwork is implemented in both …/Frameworks/GULAppDelegateSwizzler_-24B6F7B546001A5C_PackageProduct.framework/GULAppDelegateSwizzler_-24B6F7B546001A5C_PackageProduct and …/RNFBAnalytics.framework/RNFBAnalytics. This may cause spurious casting failures and mysterious crashes. One of the duplicates must be removed or renamed.

Affected classes in RNFBAnalytics: GULMutableDictionary, GULNetwork, GULNetworkURLSession, GULNetworkURLSessionWeakHolder, GULReachabilityChecker, GULSessionDeallocTracker, GoogleUtilities_GoogleUtilities_Network_SWIFTPM_MODULE_BUNDLER_FINDER, GoogleUtilities_GoogleUtilities_Reachability_SWIFTPM_MODULE_BUNDLER_FINDER

In RNFBMessaging: GULReachabilityChecker, GoogleUtilities_GoogleUtilities_Reachability_SWIFTPM_MODULE_BUNDLER_FINDER

Steps to reproduce

  1. Expo SDK 57 app with the RNFB modules listed below; @react-native-firebase/app config plugin without disableSPM; expo-build-properties with ios.useFrameworks: "dynamic" (no RNFB entries in forceStaticLinking).
  2. npx expo prebuild --clean, pod install, build Release for the iOS Simulator, launch and watch the console.

Expected: each GoogleUtilities product linked once (from the dynamic SPM package product), no duplicate classes.

Note: The same app in CocoaPods mode (disableSPM, useFrameworks: "static") shows no duplicates. Related: #9140.


Project Files

Javascript

Click To Expand

package.json:

json
{
  "dependencies": {
    "@react-native-firebase/analytics": "^26.4.0",
    "@react-native-firebase/app": "^26.4.0",
    "@react-native-firebase/app-check": "^26.4.0",
    "@react-native-firebase/auth": "^26.4.0",
    "@react-native-firebase/crashlytics": "^26.4.0",
    "@react-native-firebase/firestore": "^26.4.0",
    "@react-native-firebase/functions": "^26.4.0",
    "@react-native-firebase/messaging": "^26.4.0",
    "expo": "~57.0.18",
    "expo-build-properties": "~57.0.15",
    "react-native": "0.86.3"
  }
}

firebase.json for react-native-firebase v6:

json
# N/A

iOS

Click To Expand

ios/Podfile:

  • I'm not using Pods
  • I'm using Pods and my Podfile looks like:
ruby
# Generated by Expo prebuild (CNG). Relevant config (app.config.ts):
#   plugins: [
#     "@react-native-firebase/app",            // no disableSPM → SPM mode
#     ["expo-build-properties", { ios: { useFrameworks: "dynamic" } }],
#   ]
# Precompiled Expo modules enabled (Expo SDK 57 default).

AppDelegate.m:

objc
// N/A (Expo-generated AppDelegate.swift)


Android

Click To Expand

Have you converted to AndroidX?

  • my application is an AndroidX application?
  • I am using android/gradle.settings jetifier=true for Android compatibility?
  • I am using the NPM package jetifier for react-native compatibility?

android/build.gradle:

groovy
// N/A (iOS-only issue)

android/app/build.gradle:

groovy
// N/A

android/settings.gradle:

groovy
// N/A

MainApplication.java:

java
// N/A

AndroidManifest.xml:

xml
<!-- N/A -->


Environment

Click To Expand

react-native info output:

react-native 0.86.3 (New Architecture), Expo SDK 57
Xcode 26.6, CocoaPods 1.16.2, macOS 26.4.1
Firebase iOS SDK via SPM, resolved to 12.19.1
Build: Release, iOS Simulator (arm64)
  • Platform that you're experiencing the issue on:
    • iOS
    • Android
    • iOS but have not tested behavior on Android
    • Android but have not tested behavior on iOS
    • Both
  • react-native-firebase version you're using that has this issue:
    • 26.4.0
  • Firebase module(s) you're using that has the issue:
    • Analytics, Messaging (GoogleUtilities linkage)
  • Are you using TypeScript?
    • Y & 6.0.3

Source: invertase/react-native-firebase