This guide walks you through installing the AdMob Plus plugin in your Apache Cordova project.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/admob-plus/admob-plus/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Cordova CLI installed (
npm install -g cordova)An existing Cordova project
AdMob account with app registered
Installation
Install the Plugin
Add the plugin to your Cordova project:The plugin will automatically configure itself for Android and iOS platforms.
Configure App IDs
Set your AdMob App IDs using Cordova preferences in
config.xml:config.xml
Replace
ca-app-pub-xxx~xxx with your actual AdMob App IDs from the AdMob console.Add TypeScript Support (Optional)
If you’re using TypeScript, install type definitions:The plugin includes its own TypeScript definitions at
esm/index.d.ts.Platform-Specific Configuration
Android
The plugin automatically adds the required Google Mobile Ads SDK dependency inbuild.gradle.
Minimum Requirements:
- Android SDK 21+
- Cordova Android 10.0.0+
iOS
The plugin includes a CocoaPods dependency for the Google Mobile Ads SDK. Minimum Requirements:- iOS 12.0+
- Cordova iOS 6.0.0+
- CocoaPods installed
Verification
Verify the installation by checking the installed plugins:admob-plus-cordova in the list.
Troubleshooting
Build fails with 'Could not find' dependency error
Build fails with 'Could not find' dependency error
This usually indicates a Gradle sync issue on Android. Try:
- Remove and re-add the Android platform:
cordova platform rm android && cordova platform add android - Clean the build:
cordova clean android - Rebuild:
cordova build android
iOS build fails with CocoaPods error
iOS build fails with CocoaPods error
- Update CocoaPods:
pod repo update - Navigate to
platforms/iosand run:pod install - Rebuild:
cordova build ios
App IDs not found at runtime
App IDs not found at runtime
Ensure you’ve set both
ADMOB_APP_ID_ANDROID and ADMOB_APP_ID_IOS preferences in config.xml before building.Next Steps
Usage Guide
Learn how to display ads in your Cordova app