Integration

This guide explains how to install the Flutter plugin and configure both Android and iOS native projects.

Step 1: Install the Package

Add the dependency to your pubspec.yaml:

dependencies:
empower_mobile_ads: ^0.7.3

Then run:

flutter pub get

Step 2: Android Configuration

Add the Maven Repository

Add the Empower Maven repository to your project-level android/build.gradle:

// android/build.gradle
allprojects {
repositories {
google()
mavenCentral()
maven { url 'https://maven.empower.net/release' }
}
}

Or if your project uses settings.gradle (newer Flutter versions):

// android/settings.gradle
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven { url 'https://maven.empower.net/release' }
}
}

Configure AndroidManifest

Add the following <meta-data> tags inside the <application> block of android/app/src/main/AndroidManifest.xml:

<application>
<!-- Existing configuration -->
<meta-data
android:name="com.google.android.gms.ads.AD_MANAGER_APP"
android:value="true"/>
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy"/>
</application>

Note: Replace the APPLICATION_ID value with your actual Google Ads Application ID. Contact Empower support if you need assistance obtaining this ID.

Kotlin Version Compatibility

The Empower native SDK is compiled with Kotlin 2.3.0. If your project uses an older Kotlin compiler (1.9.x), you may see a version compatibility warning. Add this line to android/gradle.properties:

# Empower Mobile Ads SDK — Kotlin compatibility
kotlin.suppressKotlinVersionCompatibilityCheck=2.3.0

That's it — the SDK automatically injects the -Xskip-metadata-version-check compiler flag into all Kotlin compile tasks, so no additional Gradle configuration is needed.

Important: Do not use resolutionStrategy.force to downgrade kotlin-stdlib to 1.9.x. The Empower SDK depends on Kotlin 2.x coroutine classes (such as SpillingKt) at runtime. Forcing a stdlib downgrade will cause a NoClassDefFoundError crash.

Core Library Desugaring

If your project targets API level below 26, enable core library desugaring in android/app/build.gradle:

android {
compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.4'
}

Step 3: iOS Configuration

Update Your Podfile

Add the Empower specs source to the top of your ios/Podfile:

source 'https://github.com/empowernet/specs.git'
source 'https://cdn.cocoapods.org/'

Ensure the minimum deployment target is set:

platform :ios, '13.0'

Install CocoaPods Dependencies

cd ios && pod install --repo-update && cd ..

Update Info.plist

Add your Google Ads Application ID to ios/Runner/Info.plist:

<key>GADApplicationIdentifier</key>
<string>ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy</string>

Update Build Settings

Add ${inherited} to Other Linker Flags in your Xcode project:

Target → Build Settings → Other Linker Flags


Step 4: Build and Run

# Android
flutter run
# iOS
cd ios && pod install && cd ..
flutter run

Mediation Adapters

Android

Configure Repositories

Pick the path that matches your build policy. The settings plugin is the default and stays in sync with the SDK automatically. Use the manual setup only when third-party Gradle plugins are restricted in your project.

Standard setup (settings plugin)

Add the Empower maven to pluginManagement.repositories, then apply the settings plugin. The plugin registers every Maven repo the SDK and its mediation adapters need (Empower, AppLovin, Pangle, IronSource, Ogury). Bumping the plugin version is enough when networks change in a future release.

pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
maven { url = uri("https://maven.empower.net/release") }
}
}
plugins {
id("net.empower.mobile.ads.settings") version "5.7.22"
}

If your project already declares dependencyResolutionManagement (including with repositoriesMode = FAIL_ON_PROJECT_REPOS), the plugin appends to it without conflict.

Without the settings plugin

Declare every Maven repository the SDK needs yourself. You will need to add new repositories manually when the SDK adds networks in future releases.

//settings.gradle.kts
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
// Empower Mobile Ads SDK
maven {
url = uri("https://maven.empower.net/release")
content { includeGroup("net.empower.mobile.ads") }
}
// AppLovin SDK & mediation adapters
maven {
url = uri("https://artifacts.applovin.com/android")
content { includeGroupByRegex("com\\.applovin.*") }
}
// Pangle / ByteDance
maven {
url = uri("https://artifact.bytedance.com/repository/pangle/")
content { includeGroupByRegex("com\\.(bytedance|pangle).*") }
}
// IronSource / Fyber / DT Exchange
maven {
url = uri("https://android-sdk.is.com/")
content { includeGroupByRegex("com\\.(ironsource|fyber).*") }
}
// Ogury
maven {
url = uri("https://maven.ogury.co")
content { includeGroupByRegex("co\\.ogury.*") }
}
}
}

iOS

Add the mediation adapter pods to your ios/Podfile:

target 'Runner' do
use_frameworks!
# Mediation Adapters
pod 'AppLovinMediationGoogleAdManagerAdapter'
pod 'AppLovinMediationGoogleAdapter'
pod 'AppLovinMediationInMobiAdapter'
pod 'AppLovinMediationVungleAdapter'
pod 'AppLovinMediationByteDanceAdapter'
pod 'AppLovinMediationUnityAdsAdapter'
pod 'AppLovinMediationYandexAdapter'
pod 'GoogleMobileAdsMediationInMobi'
pod 'GoogleMobileAdsMediationPangle'
pod 'GoogleMobileAdsMediationUnity'
end

Then run cd ios && pod install --repo-update.

Note: Contact your Empower account manager for the recommended adapter configuration based on your target markets and revenue goals.


Troubleshooting

Plugin Not Found

If you see errors about the plugin not being found:

Android: 1. Run: flutter clean && flutter pub get && flutter run 2. Ensure maven { url 'https://maven.empower.net/release' } is in android/build.gradle

iOS: 1. Run: cd ios && pod deintegrate && pod install --repo-update && cd .. 2. Ensure source 'https://github.com/empowernet/specs.git' is in your Podfile

Kotlin Version Mismatch

If you see errors about Kotlin version incompatibility, add kotlin.suppressKotlinVersionCompatibilityCheck=2.3.0 to android/gradle.properties as described in the Android Configuration section above. Do not force-downgrade kotlin-stdlib — this causes runtime crashes.

Build Fails After Adding Mediation Adapters

Run a clean build:

# Android
cd android && ./gradlew clean && cd ..
# iOS
cd ios && pod deintegrate && pod install --repo-update && cd ..