Integration
This guide explains how to add the Empower adapter to your Android project.
Step 1: Add the Empower Repository
Add the Empower Maven repository to your project.
- Kotlin DSL
- Groovy
settings.gradle.kts
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven {
url = uri("https://maven.empower.net/release")
content { includeGroup("net.empower.mobile.ads") }
}
}
}
settings.gradle
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven {
url 'https://maven.empower.net/release'
content { includeGroup 'net.empower.mobile.ads' }
}
}
}
tip
If your project declares repositories in allprojects inside the project level build.gradle, add the Empower repository there instead.
Step 2: Add the Adapter Dependency
Add the adapter that matches your Google SDK to your app module.
- Google Mobile Ads SDK
- GMA Next-Gen SDK
- Kotlin DSL
- Groovy
app/build.gradle.kts
dependencies {
implementation("net.empower.mobile.ads:empower-mobile-ads-google-adapter:2.1.9")
}
app/build.gradle
dependencies {
implementation 'net.empower.mobile.ads:empower-mobile-ads-google-adapter:2.1.9'
}
- Kotlin DSL
- Groovy
app/build.gradle.kts
dependencies {
implementation("net.empower.mobile.ads:empower-mobile-ads-nextgen-google-adapter:1.0.1")
}
app/build.gradle
dependencies {
implementation 'net.empower.mobile.ads:empower-mobile-ads-nextgen-google-adapter:1.0.1'
}
Step 3: Project Compatibility (Java 11 + Desugaring)
Your app module must compile with Java 11 and have core library desugaring enabled.
- Kotlin DSL
- Groovy
app/build.gradle.kts
android {
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
isCoreLibraryDesugaringEnabled = true
}
}
kotlin {
jvmToolchain(11)
}
dependencies {
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.5")
}
app/build.gradle
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
coreLibraryDesugaringEnabled true
}
kotlinOptions {
jvmTarget = '11'
}
}
dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5'
}
note
Keep your own Google app ID and your own MobileAds.initialize call. The adapter needs no initialization code.
Next Steps
The adapter is now part of your project. Continue with Privacy & Consent, then add Empower to your yield groups in Mediation Setup.