Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#9,408 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
Lĩnh vực
backend, mobile

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
  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

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

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của invertase/react-native-firebase

Tất cả issue của invertase/react-native-firebase

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.