본문으로 건너뛰기
Skillpedia
모바일 앱22k · #10188

google-mobile-ads-android-migrate-to-next-gen

하는 일

클래스와 메서드에 대한 매핑 표를 사용해, 기존 Google Mobile Ads 라이브러리를 Next-Gen SDK로 바꾸는 과정을 안내합니다. 기존 광고 설정이 있는 Android 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓Android 앱이 기존 Google Mobile Ads SDK를 쓰고 있고 Next-Gen으로 옮기고 싶을 때.
  • ✓여러 파일에 걸친 오래된 광고 import와 메서드 호출을 업데이트해야 할 때.
  • ✓중복된 광고 라이브러리 심볼 때문에 빌드가 실패할 때.

스킬 링크

https://github.com/google/skills/blob/main/skills/ads/google-mobile-ads-android-migrate-to-next-gen/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/google/skills/blob/main/skills/ads/google-mobile-ads-android-migrate-to-next-gen/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“제 Android 앱을 기존 Google Mobile Ads SDK에서 Next-Gen SDK로 마이그레이션하고, 빌드가 되도록 해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 체크리스트를 따릅니다. Gradle 의존성을 업데이트하고, 최소 및 컴파일 SDK 버전을 올리고, 기존 라이브러리를 제거하고, 매핑 표를 사용해 파일마다 마이그레이션한 뒤, 깨끗한 빌드를 실행합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

AI Migration Agent Instructions for the Google Mobile Ads SDK

Migration Workflow

Use this checklist to track your migration progress:

  • Configure Gradle:
    • Replace com.google.android.gms:play-services-ads with the latest stable version of com.google.android.libraries.ads.mobile.sdk:ads-mobile-sdk. If you cannot access Maven directly, run the following command to fetch the latest version. The version returned in the latest tag is the latest version of the GMA Next-Gen SDK:

      curl -sS https://dl.google.com/dl/android/maven2/com/google/android/libraries/ads/mobile/sdk/ads-mobile-sdk/maven-metadata.xml | sed -n 's/.*<latest>\(.*\)<\/latest>.*/\1/p'
      
    • Update minSdk (24+) and compileSdk (34+).

    • Exclude play-services-ads and play-services-ads-lite from all dependencies globally in the app-level build file to avoid duplicate symbol errors.

    • Sync Gradle before moving on to the next step.

  • Per-File Migration:
    • Refactor the codebase following the API Mapping and Method Mapping tables to migrate imports, class names, and method signature to GMA Next-Gen SDK.
  • Verify and Build:
    • Run gradle build -x test to confirm a successful clean build. Resolve any GMA SDK related compile errors.

Core Migration Rules

  • App ID Usage: Always use the value of the com.google.android.gms.ads.APPLICATION_ID meta-data tag from AndroidManifest.xml for the applicationId in InitializationConfig.
    • Constraint: Preserve the <meta-data> tag in the manifest; it is still required for publishers using the User Messaging Platform SDK.
  • Initialization Sequence:
    1. Call MobileAds.initialize() on a background thread.
    2. Ensure initialize() is called before any other SDK methods.
    3. If using RequestConfiguration, bundle it into InitializationConfig.Builder.setRequestConfiguration(). Do not call MobileAds.setRequestConfiguration() before initialization.
  • UI Threading: MANDATORY: Callbacks in GMA-Next Gen SDK are invoked on a background thread. ALL UI-RELATED OPERATIONS (e.g., Toasts, View updates, Fragment transactions) MUST be wrapped in runOnUiThread {} or Dispatchers.Main.launch {} within GMA SDK callbacks. SKIPPING THIS STEP WILL CAUSE THE APPLICATION TO CRASH.
  • Mediation: Classes implementing com.google.android.gms.ads.mediation.Adapter MUST continue using com.google.android.gms.ads.

Format Specifics

Banner Ads

  • Use com.google.android.libraries.ads.mobile.sdk.banner.AdView for loading GMA Next-Gen SDK banners.
  • The following API checks if a banner is collapsible: adView.getBannerAd().isCollapsible().

Native Ads

  • NativeAdLoader: NativeAdLoader is abstract and cannot be instantiated. It is used statically (e.g., NativeAdLoader.load(...)).
  • The following APIs are now set on the NativeAdRequest.Builder:
    • .setCustomFormatIds(customFormatIds: List<String>)
    • .disableImageDownloading()
    • .setMediaAspectRatio(mediaAspectRatio: NativeMediaAspectRatio)
    • .setAdChoicesPlacement(adChoicesPlacement: AdChoicesPlacement)
    • .setVideoOptions(videoOptions: VideoOptions)
  • Removal: Delete all "Mute This Ad" logic; it is unsupported in GMA Next-Gen SDK.
  • MediaView: NativeAd no longer has a direct mediaView variable; use registerNativeAd(nativeAd, mediaView) to associate the ad with the view.

Ad preloading

  • Unless specified in the mapping table, ad preloading methods in the GMA Next-Gen SDK retain the same API signatures and parameters as the Old SDK.

API Mapping

This table covers the main classes and their GMA Next-Gen SDK equivalents.

Feature Old SDK Import (com.google.android.gms.ads...) GMA Next-Gen SDK Import (com.google.android.libraries.ads.mobile.sdk... )
자주 묻는 질문

SDK 의존성을 대신 업데이트하나요?

네. 기존 Gradle 의존성을 최신 안정 Next-Gen 버전으로 바꿉니다.

Android 버전 요구 사항은 무엇인가요?

체크리스트는 최소 SDK 24, 컴파일 SDK 34 이상을 요구합니다.

빌드가 통과하는지 확인하나요?

네. 마이그레이션이 작동하는지 확인하기 위해 깨끗한 빌드로 마무리합니다.

상세 정보

작성자의 원본 설명

Migrates Android applications from the old, legacy Google Mobile Ads (GMA) SDK (com.google.android.gms:play-services-ads) to the new GMA Next-Gen SDK (com.google.android.libraries.ads.mobile.sdk:ads-mobile-sdk). Provides comprehensive mapping tables for imports, classes, and method signatures to help determine migration steps. Use when migrating an existing Android codebase from the old, legacy GMA SDK to GMA Next-Gen SDK.

repo: google/skills

인기도

GitHub 스타
22k
순위
#10188
라이선스
Apache-2.0
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬