AdMob
AdMob Cocos2dx guide for Custom Adapter (GMA SDK).
Prerequisites
Performed by: Developer
- See the Compatibility Matrix for the minimum Android and iOS versions for this package.
Install the SDK
Performed by: Developer
-
Install the toolchain
CMake 3.6 or newer, Python 3, and Node.js 18+ for the adapter installer.
For Android: Android Studio with SDK 34 and NDK 21.4.7075529.
For iOS: Xcode with command line tools, plus CocoaPods. -
Get the engine
Download the Cocos2d-x 4.0 release and unpack it into your project ascocos2d/. -
Fetch the prebuilt dependencies
The engine ships without its third-party binaries. Run this from insidecocos2d/, or the CMake configure step will fail on missing headers.
python download-deps.py
Clone the TapMind Cocos2dx AdMob adapter installer: cocos-2dx-custom-adapter-admob-gma
- Generate and build — Android
Openproj.android/in Android Studio and run, or build from the command line. Gradle drives CMake for the native layer.
cd proj.android && ./gradlew assembleDebug
- Generate and build — iOS
CMake generates the Xcode project; CocoaPods then integrates the pods into a workspace. Open the workspace, never the.xcodeproj.
cmake -S . -B proj.ios_mac/build -GXcode \
-DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos \
-DCMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET=15.0
- Add the adapter
Run the installer against your game root — the folder holdingproj.android/andproj.ios_mac/. It writes the Gradle dependency and the Podfile entry between managed markers.
node inject.js --project /path/to/game [--platform android|ios|all]
It wires the dependency only. The Google Mobile Ads SDK arrives transitively, but your AdMob App ID and all load/show code are yours to add.
- Run Pod
cd proj.ios_mac && pod install
open CocosSampleProject.xcworkspace
App ID Configuration: Ensure the App ID used in the application matches the App ID configured for TapMind in the AdMob mediation/waterfall. Using a different App ID may prevent the TapMind SDK from initializing correctly.
Configure AdMob
Performed by: Ad ops
Refer AdMob Mediation Integration Setup for the integration.
Refer Class & Network Key Registry for the classnames.
Verify integration
Performed by: Developer
After install and dashboard configuration:
- Run your app in a debug build. TapMind's test mode is enabled automatically in debug builds and serves test ads at a high fill rate.
- Request an ad through your mediation SDK as you normally would.
- Confirm a TapMind ad fills. Check logs for the tag
TapMindAdapter. - When verified, build in release mode for production - test mode is disabled automatically in release builds, and live ads serve.
Note: Test mode is automatic. It follows your build type: debug = test ads, release = live ads. There is no flag to enable or disable, and nothing to turn off before going live.
Release build QA: There is currently no documented release-safe test path to validate R8/ProGuard without serving live ads. Consumer ProGuard rules from the TapMind AAR are applied automatically when you integrate the published adapter packages.
Troubleshooting
Performed by: Developer
Before diving into logs, confirm adapter class names and the LevelPlay network key against the Class & Network Key Registry, placementName, placementcode and eCPM/rate with your account manager.
See Troubleshooting for common symptoms, mediation-specific fixes, release vs debug guidance, and escalation steps. Partner-specific verification steps are under Verify integration above.
