Many production apps ship react-native-google-mobile-ads
together with react-native-firebase. Both are Invertase packages and are
designed to coexist — Ads monetization and Firebase (Analytics, Crashlytics, Auth, and the rest of
the RNFB suite) in one React Native app.
This page is the coexistence guide for Expo and bare React Native. Follow React Native Firebase for Firebase install details, and this library's Install with Expo or Install with React Native CLI for Ads. The sections below cover the native build choices that matter when both are present.
Compatible with bare React Native 0.88, Expo SDK 58, @react-native-firebase/app
26.4.x (SPM default), and react-native-google-mobile-ads 17.2.x when the Podfile stays
dynamic for RNFB SPM while this module is forced static
($RNGoogleMobileAdsAsStaticFramework = true), plus the CocoaPods static-transitive check bypass
for Google's Mobile Ads / UMP (and optional mediation adapter) static frameworks. Do not treat
“dynamic frameworks alone, no ads static flag” as the working recipe.
| Concern | React Native Google Mobile Ads | React Native Firebase |
|---|---|---|
| Product config | AdMob App ID (GADApplicationIdentifier / Android meta-data) | GoogleService-Info.plist / google-services.json |
| Expo install | Config plugin + development build | @react-native-firebase/* plugins + Google Services files |
| Bare install | app.json App IDs + autolinking | Autolinking + Firebase native setup per rnfirebase.io |
| iOS frameworks (recommended) | $RNGoogleMobileAdsAsStaticFramework = true under a dynamic Podfile | use_frameworks! :linkage => :dynamic + SPM (default) |
| iOS frameworks (legacy opt-out) | Same static-ads flag under a fully static Podfile | disableSPM + static (+ forceStaticLinking as needed) — see deprecated |
Both AdMob App IDs and Firebase Google Services files are required. One does not replace the other. See App IDs vs Firebase configuration.
- Meet this library's platform baseline (React Native 0.86+, New Architecture,
iOS 15.1+, Android
minSdk24). - New Architecture is required. Explicit Legacy Architecture opt-out fails CocoaPods install
for this module on iOS, and this module's Android Gradle build fails whenever
newArchEnabledis present and nottrue, even though React Native 0.82+ may ignore that flag. See New Architecture (required). - Install and configure each library normally — there is no special combined npm package.
- React Native Firebase 26.1+ on React Native ≥ 0.75 defaults to resolving the Firebase Apple SDK via Swift Package Manager. That is the path this page optimizes for. If you have not upgraded to SPM yet, see Deprecated: React Native Firebase before SPM.
React Native Firebase's SPM path needs a dynamic use_frameworks! Podfile
(useFrameworks: "dynamic" on Expo). Google's Mobile Ads / UMP SDKs (and optional mediation
adapter packages) still ship as static frameworks through CocoaPods.
If RNGoogleMobileAds stays a dynamic framework under that Podfile, the iOS link step fails with
many undefined GAD* / UMP* (and sometimes adapter) Objective-C classes. The fix is not to
disable RNFB SPM. Keep the Podfile dynamic for Firebase, and force this module to build as a
static framework so it can absorb Google's static binaries.
CocoaPods then refuses those static frameworks as transitive dependencies of a dynamic
use_frameworks! graph unless you disable the static-transitive dependency check (a common React
Native workaround). Both pieces — $RNGoogleMobileAdsAsStaticFramework = true and the
pre_install TargetValidator override — appear together in the
canonical Podfile snippet below.
Put those lines before the app target block (bare), or inject the ads-only extras into the
generated Expo ios/Podfile after prebuild (see Expo). Re-run pod install / rebuild
after changing them.
Do not set ios.useFrameworks: "static" (or bare use_frameworks! :linkage => :static) while
React Native Firebase is still in its default SPM mode. pod install fails with:
[react-native-firebase] SPM + static linkage is not supported
That combination is unsupported. Use the hybrid recipe in this section, or the
deprecated before SPM / disableSPM path only if you
intentionally opt out of SPM.
- Install React Native Firebase and follow its iOS SPM / dynamic frameworks guidance (iOS SPM Support).
- Install this module and set App IDs in
app.json— see Install with React Native CLI. - In the
Podfile, before anytargetblock, enable dynamic frameworks for RNFB and the hybrid ads flags:
# RNFB SPM expects dynamic frameworks (RN ≥ 0.75 + RNFB ≥ 26.1 defaults).
use_frameworks! :linkage => :dynamic
# Ads pod must be static so Google's static Mobile Ads / UMP frameworks link.
$RNGoogleMobileAdsAsStaticFramework = true
pre_install do |_installer|
Pod::Installer::Xcode::TargetValidator.send(
:define_method,
:verify_no_static_framework_transitive_dependencies,
) {}
end- Run
npx pod-installand rebuild. Autolinking is sufficient for basic coexistence. - On newer Xcode versions, if resource-bundle pods fail with an
IPHONEOS_DEPLOYMENT_TARGETbelow 15.1, clamp targets inpost_install— see iOS CocoaPods deployment targets.
React Native 0.88, RNFB 26.4 (SPM), and this module 17.2 coexist on that hybrid Podfile for Debug iOS simulator builds, including optional Google mediation adapter packages when their CocoaPods pins admit the core Mobile Ads SDK version (see Mediation).
- Install and configure React Native Firebase per
rnfirebase.io (plugins,
googleServicesFile, rebuild). - Install this module and set AdMob App IDs on the config plugin — see Install with Expo.
- Set
expo-build-propertiesto dynamic frameworks (RNFB's documented SPM default):
// <project-root>/app.json
{
"expo": {
"plugins": [
"@react-native-firebase/app",
[
"react-native-google-mobile-ads",
{
"androidAppId": "ca-app-pub-xxxxxxxx~xxxxxxxx",
"iosAppId": "ca-app-pub-xxxxxxxx~xxxxxxxx"
}
],
[
"expo-build-properties",
{
"ios": {
"useFrameworks": "dynamic"
}
}
]
]
}
}- After
npx expo prebuild --platform ios, inject the ads static flag and static-transitive check bypass into the generatedios/Podfilebefore the apptarget(commit them via a small config plugin /withDangerousMod, or re-apply after every clean prebuild). Do not repeatuse_frameworks!here —expo-build-propertiesalready set dynamic frameworks. The owner snippet (including comments) is under Bare React Native; Expo needs only these extras:
$RNGoogleMobileAdsAsStaticFramework = true
pre_install do |_installer|
Pod::Installer::Xcode::TargetValidator.send(
:define_method,
:verify_no_static_framework_transitive_dependencies,
) {}
end- Run
pod installinios/(or letexpo run:iosinstall pods) and rebuild a development build. Autolinking wires both libraries; you do not need to hand-editAppDelegateorMainApplicationfor basic Ads + Firebase linking. - If resource-bundle pods fail on
IPHONEOS_DEPLOYMENT_TARGET, apply the same clamp as bare — iOS CocoaPods deployment targets.
expo-build-properties alone does not set $RNGoogleMobileAdsAsStaticFramework. Dynamic
useFrameworks without the static-ads override is the combination that fails to link GAD* /
UMP* symbols.
Google Mobile Ads and Firebase use different configuration artifacts:
| Platform | Ads (this module) | Firebase (RNFB) |
|---|---|---|
| iOS | GADApplicationIdentifier in Info.plist (Expo plugin or bare ios_app_id) | GoogleService-Info.plist |
| Android | com.google.android.gms.ads.APPLICATION_ID meta-data (plugin or android_app_id) | google-services.json |
- Both are required. Firebase Google Services files do not supply AdMob App IDs, and AdMob App IDs do not replace Firebase configuration.
- On Expo, App IDs on the config plugin alone are sufficient for Ads — you do not also need a
root-level
react-native-google-mobile-adsJSON block. A legacy iOS config-script warning about a missing rootios_app_idcan appear during builds; it is safe to ignore when the Expo plugin already injected the App ID. - See Google AdMob for where to find AdMob App IDs.
On Android, React Native Firebase and this module both depend on Google Play services / Firebase Android artifacts, but they own different concerns:
- Firebase versions are typically aligned through the Firebase Android BOM / Google Services Gradle plugin as documented by React Native Firebase.
- Ads are selected by this library: classic
play-services-adsby default, or the Next Genads-mobile-sdkwhen you setandroidSdk: "nextgen"(Expo) /android_sdk/RNGMA_ANDROID_BACKEND(bare). See Config plugin reference.
Coexistence Android builds succeed with the default classic backend and with androidSdk: "nextgen". Practical guidance:
- Let each library manage its own ads / Firebase dependencies. Do not hand-force conflicting
play-services-adsor Firebase BOM versions in the appbuild.gradleunless you are debugging a specific resolution failure. - Keep
google-services.jsonfor Firebase and the AdsAPPLICATION_IDmeta-data from this module's config. - After changing
androidSdk/ backend properties, do a clean Android rebuild so Gradle picks up the new dependency graph.
Optional Google mediation adapter packages (scoped @react-native-google-mobile-ads/<network>
npm packages or the corresponding CocoaPods / Maven artifacts) follow the same hybrid iOS linkage
as core Mobile Ads / UMP. Adapter CocoaPods pins can still conflict with the core
Google-Mobile-Ads-SDK version independently of SPM or frameworks mode — see
Mediation (including the Yandex iOS pin note) rather than treating pin fights as an
SPM issue.
Prefer config plugins (Expo) and documented Podfile / app.json knobs (bare). Avoid:
- Hand-writing
GADApplicationIdentifieror AndroidAPPLICATION_IDwhen the Expo config plugin (or bareapp.jsonApp ID keys) already sets them — edit the source of truth, then rebuild. - Mixing RNFB SPM with static
use_frameworks!/useFrameworks: "static". - Omitting
$RNGoogleMobileAdsAsStaticFramework = trueon the RNFB SPM + dynamic Podfile path (dynamic ads pod under dynamic frameworks fails to link Google's static Mobile Ads / UMP binaries). - Treating the install-page “fully static
useFrameworks” snippet as the React Native Firebase default (see Install with Expo and Install with React Native CLI; those sections defer here for RNFB). - Manually patching
AppDelegate/MainApplicationsolely to “enable” Ads or Firebase linking when autolinking and the config plugins already apply. - Deleting Firebase Google Services files because AdMob App IDs are present (or the reverse).
- Jumping to manual
GoogleUtilitiesPodfile pins before fixing SPM vs frameworks mode (see deprecated section below).
- Install RNFB and this module; configure both Google Services files and AdMob App IDs.
- Enable New Architecture; rebuild native projects after plugin / Podfile changes.
- Prefer RNFB SPM + dynamic Podfile +
$RNGoogleMobileAdsAsStaticFramework = true+ the static-transitive check bypass. - Never combine RNFB SPM with a fully static
use_frameworks!/useFrameworks: "static". - On Android, leave Firebase BOM / Google Services and this module's ads backend to their documented knobs; clean-rebuild after backend changes.
- Initialize Ads in JS as usual (Initialization); configure Firebase per RNFB docs. The two JS surfaces are independent.
The guidance below is for apps still on React Native Firebase before the SPM-default line (or
that intentionally set $RNFirebaseDisableSPM / disableSPM: true). If you are on RNFB 26.1+
with SPM enabled, do not follow this section — use Recommended path: RNFB SPM + dynamic
Podfile + static ads pod instead.
Older coexistence docs assumed Firebase Apple SDKs were resolved entirely through CocoaPods,
often with static use_frameworks!, and focused on aligning shared Google pods (especially
GoogleUtilities) by hand to avoid duplicate-symbol linker errors when Ads and Firebase both
pulled the same utilities.
That world is obsolete for current RNFB. Keep the material below only if you have not upgraded to SPM yet and cannot move yet.
Use this only when you intentionally need static frameworks for the whole Podfile (for example to
share one FirebaseCore with another CocoaPods-only dependency) and you have disabled RNFB
SPM.
Pass disableSPM on @react-native-firebase/app, set useFrameworks: "static", and list every
RNFB native module you use in forceStaticLinking. Expo documents forceStaticLinking as the list of
pods to link statically when use_frameworks! is on, because some pods (especially alongside React
Native prebuilt binaries) fail as dynamic frameworks; see
expo-build-properties.
// <project-root>/app.json
{
"expo": {
"plugins": [
[
"@react-native-firebase/app",
{
"ios": {
"disableSPM": true
}
}
],
[
"react-native-google-mobile-ads",
{
"androidAppId": "ca-app-pub-xxxxxxxx~xxxxxxxx",
"iosAppId": "ca-app-pub-xxxxxxxx~xxxxxxxx"
}
],
[
"expo-build-properties",
{
"ios": {
"useFrameworks": "static",
"forceStaticLinking": ["RNFBApp"]
}
}
]
]
}
}Extend forceStaticLinking with every other RNFB module you install (for example RNFBAuth,
RNFBCrashlytics). Rebuild after changing plugins.
- In the
Podfile, before any target block, disable RNFB SPM and enable static frameworks for this module:
$RNFirebaseDisableSPM = true
$RNGoogleMobileAdsAsStaticFramework = true- Configure
use_frameworks! :linkage => :staticas required by your Firebase / other native setup (see RNFB and Install with React Native CLI). - Run
npx pod-installand rebuild.
Older coexistence guides (before RNFB's SPM default) focused on aligning GoogleUtilities (and
related Firebase pods) by hand to avoid duplicate-symbol linker errors when Ads and Firebase both
pulled Google's shared utilities through CocoaPods.
On the current recommended hybrid path (RNFB SPM + dynamic Podfile + static ads pod), iOS
builds succeed without manual GoogleUtilities pin surgery. RNFB's SPM + static guard exists
specifically to block the unsupported “SPM + fully static Podfile” combination.
If you are still on RNFB without SPM and see duplicate-symbol linker errors:
- Confirm you are not accidentally mixing SPM with static frameworks.
- Prefer upgrading to RNFB's SPM default and the recommended hybrid path,
or a clean static +
disableSPMsetup — not a half-migrated hybrid of the two eras. - Only then consider cleaning pods (
rm -rf ios/Pods ios/Podfile.lockand reinstall) before chasingGoogleUtilitiesversion pins by hand.