Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

🔥 [🐛] SPM + dynamic frameworks: GoogleUtilities classes still duplicated in RNFBMessaging when Analytics is not installed (follow-up to #9322)

Aperta
#9,408 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
ios, swift, typescript
Ambito
backend, mobile

Direzione di ricerca

Start with RNFBMessaging.podspec and the GoogleUtilities SPM dependency declarations added in #9327; compare the Messaging-only dependency graph with the Analytics-enabled graph. Reproduce using the listed Expo SDK 58 dynamic-framework setup and confirm the duplicate definitions with nm -U. Done means the eight GoogleUtilities classes are no longer defined in both RNFBMessaging.framework and the package-product framework in a Messaging-only app.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Issue

With RNFB 27.1.0 in SPM mode and useFrameworks: "dynamic" (Expo SDK 58), the app builds and runs. At launch, though, the Objective-C runtime reports 8 GoogleUtilities classes as implemented twice. One copy is in the GULAppDelegateSwizzler package-product framework and the other is linked statically into RNFBMessaging.framework.

This is the class list from #9322. #9327 (in 27.0.0) fixed it by declaring GULNetwork, GULReachability and GULMethodSwizzler as explicit spm_dependency products on both RNFBMessaging and RNFBAnalytics. As far as I can tell, the CI check for that fix always had Analytics in the graph. This app uses Messaging without Analytics, so RNFBMessaging is the only target that declares those products, and Xcode links them into it privately.

Modules installed: app, auth, firestore, messaging. No analytics.

Console at launch, with paths shortened:

objc[…]: Class GULNetwork is implemented in both …/<App>.app/Frameworks/GULAppDelegateSwizzler_-24B6F7B546001A5C_PackageProduct.framework/GULAppDelegateSwizzler_-24B6F7B546001A5C_PackageProduct and …/<App>.app/Frameworks/RNFBMessaging.framework/RNFBMessaging. This may cause spurious casting failures and mysterious crashes. One of the duplicates must be removed or renamed.

The same line appears for GULMutableDictionary, GULNetworkURLSession, GULNetworkURLSessionWeakHolder, GULReachabilityChecker, GULSessionDeallocTracker, GoogleUtilities_GoogleUtilities_Network_SWIFTPM_MODULE_BUNDLER_FINDER and GoogleUtilities_GoogleUtilities_Reachability_SWIFTPM_MODULE_BUNDLER_FINDER. Running nm -U over the app bundle shows the same 8 classes defined in both binaries.

What I tried

Each row is a clean Release build on the iOS 27.0 simulator. Duplicates are counted from the launch console and confirmed with nm.

Variant Duplicate classes at launch
27.1.0 as shipped 8, as listed above
RNFBMessaging.podspec with its explicit GoogleUtilities spm_dependency block disabled 2: GULReachabilityChecker and the Reachability finder, in RNFBMessaging and in the GULAppDelegateSwizzler package product
As shipped, plus the app target linking GULNetwork, GULReachability and GULMethodSwizzler 8: Xcode adds GoogleUtilities-Network.framework and GoogleUtilities-Reachability.framework, but the GULAppDelegateSwizzler package product still carries its own copy

So in an app with Messaging but no Analytics, the explicit declaration from #9327 seems to create the private copy of the network classes. Even without it, the reachability pair from the original #9322 report remains.

Steps to reproduce
  1. An Expo SDK 58 app with @react-native-firebase/app, auth, firestore and messaging at 27.1.0, and no analytics.
  2. In app.json, the @react-native-firebase/app plugin with no options, and expo-build-properties with ios.useFrameworks: "dynamic".
  3. Run npx expo prebuild --platform ios --clean, then npx expo run:ios --configuration Release.
  4. Launch with xcrun simctl launch --console-pty <udid> <bundle id> to see the objc[…] lines. They go to stderr, so the unified log stream does not show them.

I saw no crash in a short launch. For context, the app also uses @react-native-google-signin/google-signin. The 8 duplicates appear both with its stock CocoaPods setup and with a local patch that moves GoogleSignIn 10.1.0 to SPM. That patch removed every duplicate between CocoaPods and SPM, so these 8 are the only ones left. I have not tested with Google Sign-In removed entirely.


Project Files

Javascript
Click To Expand

package.json:
{
  "dependencies": {
    "@react-native-firebase/app": "^27.1.0",
    "@react-native-firebase/auth": "^27.1.0",
    "@react-native-firebase/firestore": "^27.1.0",
    "@react-native-firebase/messaging": "^27.1.0",
    "@react-native-google-signin/google-signin": "^16.1.5",
    "expo": "^58.0.0",
    "expo-build-properties": "~58.0.11",
    "react": "19.3.0",
    "react-native": "0.88.0"
  }
}
firebase.json for react-native-firebase v6:
# Only Firebase CLI keys (firestore rules and indexes). No react-native-firebase keys.
iOS
Click To Expand

ios/Podfile:
  • I'm not using Pods
  • I'm using Pods and my Podfile looks like:
# Generated by `npx expo prebuild` (Expo SDK 58). The relevant lines:
platform :ios, podfile_properties['ios.deploymentTarget'] || '16.4'
use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks']
# ios/Podfile.properties.json: "ios.useFrameworks": "dynamic"
AppDelegate.m:
// AppDelegate.swift from the Expo SDK 58 template (UIScene life cycle).
// FirebaseApp.configure() is inserted by the @react-native-firebase/app config plugin.


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:
// N/A, iOS-only issue
android/app/build.gradle:
// N/A
android/settings.gradle:
// N/A
MainApplication.java:
// N/A
AndroidManifest.xml:
<!-- N/A -->


Environment

Click To Expand

react-native info output:

Collected by hand (Expo project):
macOS 27.2
Xcode 27.1 (27A9275), iOS 27.0 simulator
CocoaPods 1.17.0
Node 24.18.0, npm 12.0.2
react 19.3.0, react-native 0.88.0, expo 58.0.20
firebase-ios-sdk 13.1.1 (SPM), GoogleUtilities 8.1.5 (SPM)
  • 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:
    • 27.1.0
  • Firebase module(s) you're using that has the issue:
    • Messaging (with App, Auth, Firestore; no Analytics)
  • Are you using TypeScript?
    • Y & 6.0.3

Lingua principale
TypeScript
Stelle
12.3k
Fork
2.3k
Merge medio
1g 16h
PR unite (30g)
23

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di invertase/react-native-firebase

Tutte le issue di invertase/react-native-firebase

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.