Commit 4560889
committed
Add modular headers support to Objective-C Firebase pods for static framework compatibility
This commit adds DEFINES_MODULE = YES to the pod_target_xcconfig section of
FirebaseCore, FirebaseInstallations, and FirebaseCoreExtension podspecs.
## Problem
Swift-based Firebase pods (FirebaseCoreInternal, FirebaseCrashlytics, FirebaseSessions)
depend on Objective-C Firebase pods. When using static frameworks via
'use_frameworks! :linkage => :static', Swift cannot import Objective-C dependencies
unless those dependencies define module maps.
This prevents React Native (New Architecture), Expo, and other frameworks from using
Firebase with static linking, resulting in errors like:
- "The Swift pod X depends upon Y, which does not define modules"
- "include of non-modular header inside framework module"
## Solution
Enable module map generation by adding 'DEFINES_MODULE' => 'YES' to the
pod_target_xcconfig in:
- FirebaseCore.podspec
- FirebaseInstallations.podspec
- FirebaseCoreExtension.podspec (new section added)
When DEFINES_MODULE is enabled, CocoaPods automatically generates module.modulemap
files, allowing Swift code to properly import these Objective-C dependencies in
static framework builds.
## Impact
- Enables static framework usage for React Native, Expo, and other frameworks
- Maintains full backward compatibility with existing projects
- No breaking changes - dynamic frameworks continue to work as before
- Aligns with modern iOS build practices and CocoaPods best practices
## Testing
All modified podspecs pass validation:
- pod spec lint FirebaseCore.podspec --quick --allow-warnings
- pod spec lint FirebaseInstallations.podspec --quick --allow-warnings
- pod spec lint FirebaseCoreExtension.podspec --quick --allow-warnings
## Related Issues
Resolves #15249
Related to:
- invertase/react-native-firebase#6933
- invertase/react-native-firebase#6332
- expo/expo#39607
## Note
External dependencies (GoogleUtilities, GoogleDataTransport, nanopb) are maintained
in separate repositories and would benefit from similar changes for complete resolution.1 parent 436de0b commit 4560889
File tree
3 files changed
+6
-0
lines changed3 files changed
+6
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
37 | 41 | | |
38 | 42 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| |||
0 commit comments