You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Starting with React Native >= 0.75, `@react-native-firebase` supports **Swift Package Manager (SPM)** for resolving Firebase iOS SDK dependencies. SPM is enabled by default — no configuration needed.
41
+
Starting with React Native 0.75+, `@react-native-firebase` supports **Swift Package Manager (SPM)** for resolving Firebase iOS SDK dependencies. SPM is enabled by default when the `spm_dependency` macro is available (injected by React Native >= 0.75) — no configuration needed.
42
42
43
43
### How it works
44
44
45
45
Each RNFB module uses `firebase_dependency()` (defined in `firebase_spm.rb`) to declare its Firebase dependencies. This helper automatically chooses between:
|`$RNFirebaseDisableSPM = true` in Podfile |**CocoaPods**| Static linkage / no pre-built RN core (`use_frameworks! :linkage => :static`) |
51
+
| RN < 0.75 |**CocoaPods** (automatic fallback) | Older React Native versions without `spm_dependency` support |
52
+
53
+
> **Note on linkage:** firebase-ios-sdk SPM products use dynamic linkage. When using `use_frameworks! :linkage => :static`, each pod embeds its own copy of Firebase SPM products, causing duplicate symbol errors. Use CocoaPods mode (`$RNFirebaseDisableSPM = true`) with static linkage.
52
54
53
55
### Configuration
54
56
55
-
**Option A — SPM (default, recommended for Xcode 26+)**
57
+
#### Option A — SPM (default, recommended for Xcode 26+)
56
58
57
59
No changes needed. Just make sure your Podfile uses dynamic linkage:
# SPM: upload-symbols is in the SourcePackages checkout
27
-
SPM_UPLOAD_SYMBOLS=$(find "${BUILD_DIR%Build/*}SourcePackages/checkouts/firebase-ios-sdk/Crashlytics" -name "upload-symbols" -type f 2>/dev/null | head -1)
28
-
if [[ -n"${SPM_UPLOAD_SYMBOLS}" ]];then
26
+
# SPM: upload-symbols is at a known path in the SourcePackages checkout.
27
+
# BUILD_DIR is typically DerivedData/Project-hash/Build/Products — strip from /Build onward
28
+
# to get the DerivedData project root where SourcePackages lives.
0 commit comments