🔥 [🐛] SPM + dynamic frameworks: GoogleUtilities classes still duplicated in RNFBMessaging when Analytics is not installed (follow-up to #9322)
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
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
- An Expo SDK 58 app with
@react-native-firebase/app,auth,firestoreandmessagingat 27.1.0, and noanalytics. - In
app.json, the@react-native-firebase/appplugin with no options, andexpo-build-propertieswithios.useFrameworks: "dynamic". - Run
npx expo prebuild --platform ios --clean, thennpx expo run:ios --configuration Release. - Launch with
xcrun simctl launch --console-pty <udid> <bundle id>to see theobjc[…]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.settingsjetifier=truefor Android compatibility? - I am using the NPM package
jetifierfor 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-firebaseversion you're using that has this issue:27.1.0
Firebasemodule(s) you're using that has the issue:Messaging(withApp,Auth,Firestore; noAnalytics)
- 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
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di invertase/react-native-firebase
-
platform: android type: enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
invertase/react-native-firebase#9399 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 1-2 giorni Idoneità per principianti 54/100
invertase/react-native-firebase#9407 ·
I maintainer di solito rispondono entro 1 giorno
-
🔥 [iOS][Crashlytics] dSYM input uses TARGET_NAME when product name differs; pod install restores incorrect pathForse già presa @Mastersam07 l’ha presa 2 giorni fa. Apertaplatform: ios plugin: crashlytics type: bug
invertase/react-native-firebase#9404 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
type: enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
invertase/react-native-firebase#9402 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Bump Firebase Android SDK (35.0.2 → 35.1.0)Forse già presa @SelaseKay l’ha presa 5 giorni fa. ApertaNeeds Attention type: enhancement
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 25/100
invertase/react-native-firebase#9397 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di invertase/react-native-firebase
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
better-auth/better-auth#12132 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
o8 next debug build aborts on Glass to Dark appearance switch (nil identifier messaged before check)Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
hurttlocker/o8#5112 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
webrecorder/wabac.js#386 ·
-
needs-triage
Difficoltà 1/5 1-3 ore Idoneità per principianti 92/100
agent-of-empires/agent-of-empires#5098 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno