Skip to content
Back to skills

Google Mobile Ads Android Migrate To Next Gen

ASecurity

Use when migrating Android apps from legacy GMA SDK to GMA Next-Gen SDK.

  • 2 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 10, 2026
ai-agentsgokotlinapi

Works with

  • api

Security analysis

A100/100

Scanned September 10, 2026

npx -y skills add LoopyLuci/Skills --skill google-mobile-ads-android-migrate-to-next-gen --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Google Mobile Ads Android Migrate To Next Gen?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Google Mobile Ads Android Migrate To Next Gen
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/loopyluci-google-mobile-ads-android-migrate-to-next-gen/badge)](https://www.skillsdirectory.com/skills/loopyluci-google-mobile-ads-android-migrate-to-next-gen)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: google-mobile-ads-android-migrate-to-next-gen
description: Use when migrating Android apps from legacy GMA SDK to GMA Next-Gen SDK.
tags: [android, google-mobile-ads, migration, gma-sdk, kotlin]
related_skills: [google-mobile-ads-get-started, android-native-dev]
---

# Google Mobile Ads SDK — Migration to GMA Next-Gen

Provides comprehensive mapping tables for migrating Android applications from the legacy `com.google.android.gms:play-services-ads` SDK to the new `com.google.android.libraries.ads.mobile.sdk:ads-mobile-sdk`.

## Migration Workflow

1. **Configure Gradle**: Replace dependency, update `minSdk` (24+) and `compileSdk` (34+)
2. **Per-file migration**: Refactor imports, class names, and method signatures
3. **Verify and build**: Run `gradle build -x test` to confirm clean build

## Code Example: Gradle Dependency

```kotlin
// Old (legacy)
// implementation("com.google.android.gms:play-services-ads:23.0.0")

// New (Next-Gen)
implementation("com.google.android.libraries.ads.mobile.sdk:ads-mobile-sdk:LATEST_VERSION")
```

## Key Migration Rules

- **App ID**: Preserve `com.google.android.gms.ads.APPLICATION_ID` meta-data in manifest
- **UI Threading**: Callbacks invoke on background thread — wrap UI operations in `runOnUiThread{}`
- **Initialization**: Call `MobileAds.initialize()` on background thread; bundle `RequestConfiguration` into `InitializationConfig`
- **Banner ads**: Use `com.google.android.libraries.ads.mobile.sdk.banner.AdView`
- **Response info**: Use `ad.getResponseInfo()` (not `.responseInfo`)

## Common Pitfalls

- **Missing dependency exclusion**: Exclude `play-services-ads` and `play-services-ads-lite` globally to avoid duplicate symbol errors
- **UI thread crashes**: All UI operations in GMA callbacks MUST use `runOnUiThread{}` or `Dispatchers.Main`
- **AdSize mismatch**: AdSize is now declared in `BannerAdRequest`, not on `AdView`
- **MediaView removed**: Use `registerNativeAd(nativeAd, mediaView)` instead of `nativeAd.mediaView`

## Verification Checklist

- [ ] Gradle dependency updated to `ads-mobile-sdk`
- [ ] `minSdk` >= 24, `compileSdk` >= 34
- [ ] Legacy SDK excluded from all transitive dependencies
- [ ] Build succeeds: `gradle build -x test`
- [ ] All imports refactored per API mapping table

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.