🔥 [🐛] SPM + dynamic frameworks: GoogleUtilities classes still duplicated in RNFBMessaging when Analytics is not installed (follow-up to #9322)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- ios, swift, typescript
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- TypeScript
- Star
- 12.3k
- Fork
- 2.3k
- Merge trung bình
- 1 ngày 16 giờ
- Pull request đã merge (30 ngày)
- 23
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của invertase/react-native-firebase
-
Needs Attention type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
invertase/react-native-firebase#9414 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
platform: android type: enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
invertase/react-native-firebase#9399 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
impact: web-implementation platform: all plugin: firestore type: bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
invertase/react-native-firebase#9413 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
impact: web-implementation platform: all plugin: firestore type: bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
invertase/react-native-firebase#9412 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
platform: ios plugin: messaging type: bug
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 54/100
invertase/react-native-firebase#9407 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của invertase/react-native-firebase
Issue tương tự
-
b:minor bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
software-mansion/argent#1698 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
e2e-failure ready-to-code
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
redhat-developer/rhdh-plugin-export-overlays#4624 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
better-auth/better-auth#12132 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
automation missing-model model-sync provider:tinfoil
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
anomalyco/models.dev#12053 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
o8 next debug build aborts on Glass to Dark appearance switch (nil identifier messaged before check)Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
hurttlocker/o8#5112 ·