Skip to main content

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:

pubspec.yaml
dependencies:
empower_mobile_ads: ^0.9.10

Plugin 0.9.10 bundles native Android SDK 5.9.9. Use that same version for the Android mediation bundle below.

Then run:

flutter pub get

Step 2: Android Configuration​

Add the Maven Repositories​

Declare the Maven repositories of the SDK and its mediation networks in the allprojects block of your project level android/build.gradle.kts. Flutter projects declare their repositories there, so repositories in settings.gradle and the Empower settings plugin have no effect in a Flutter app.

android/build.gradle.kts
allprojects {
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.*") }
}
// Mintegral
exclusiveContent {
forRepository {
maven { url = uri("https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea") }
}
filter { includeGroupByRegex("com\\.mbridge.*") }
}
}
}

Note: Mintegral is served only from its own repository. Keep it in the exclusiveContent block, or the build fails while looking for Mintegral in the other repositories.

Add the Mediation Bundle​

The plugin brings the core Android SDK only. Mediated networks come from a mediation bundle that you add to your app module, the same bundle native Android apps use. Without it the SDK serves Empower campaigns only. Pick the bundle that matches your project:

BundleUse when
empower-mobile-ads-mediationDefault. minSdk 23 or higher, Google Mobile Ads 24.0.0 or newer.
empower-mobile-ads-mediation-legacyminSdk 21 or 22, or a project that must stay on Google Mobile Ads below 24.
android/app/build.gradle.kts
dependencies {
implementation("net.empower.mobile.ads:empower-mobile-ads-mediation:5.9.9")
}

Note: The bundle version must match the native SDK bundled by the plugin, 5.9.9 for plugin 0.9.10. To use the legacy bundle, replace empower-mobile-ads-mediation with empower-mobile-ads-mediation-legacy in the line above.

Add the Google App ID​

Add the Empower application ID inside the <application> tag of android/app/src/main/AndroidManifest.xml, exactly as below:

<manifest>
<application>
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-6593523210010154~7395142271"/>
</application>
</manifest>
warning

If this meta-data entry is missing or wrong, the app crashes at startup with "The Google Mobile Ads SDK was initialized incorrectly". Use the value exactly as shown.

Kotlin Version​

The mediation bundle needs Kotlin 2.1 or newer. New Flutter projects already use a newer version. In an older project, raise the Kotlin plugin in android/settings.gradle.kts:

plugins {
id("org.jetbrains.kotlin.android") version "2.1.0" apply false
}

Important: Do not use resolutionStrategy.force to move kotlin-stdlib to an older version. The SDK needs Kotlin 2 classes at runtime, and the app crashes with a NoClassDefFoundError without them.

Java 11 and Desugaring​

Your app module must compile with Java 11 or newer and have core library desugaring enabled.

android/app/build.gradle.kts
android {
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
isCoreLibraryDesugaringEnabled = true
}
}

dependencies {
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.5")
}

DEX Code Optimization​

From February 2027 Google Play requires release builds to reach at least 25% in DEX code optimization. Apply the two steps below so your app meets this requirement.

Step 1: Add the optimization block to the release build type of your app module.

android/app/build.gradle.kts
android {
buildTypes {
release {
// your existing settings
optimization {
keepRules {
ignoreFrom(
"com.applovin.mediation:vungle-adapter",
"com.applovin.mediation:inmobi-adapter",
"com.google.ads.mediation:inmobi"
)
}
}
}
}
}

Note: The ignoreFrom call needs Android Gradle Plugin 8.6 or newer.

Step 2: Add these rules to android/app/proguard-rules.pro.

-keep class com.vungle.ads.** { *; }
-keep class com.inmobi.** { *; }
-keep class com.squareup.picasso.** { *; }
-keep class androidx.browser.customtabs.CustomTabsService { *; }
-keep class androidx.recyclerview.widget.RecyclerView { *; }
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer
-keepattributes Signature
-keepattributes *Annotation*
-dontwarn com.inmobi.**
-dontwarn com.squareup.okhttp.**
-dontwarn com.moat.**
-dontwarn sun.misc.**

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'

The Empower SDK ships as a Swift binary framework, so the Runner target must use dynamic frameworks. Add use_frameworks! inside your target 'Runner' do block (leave the rest of the Flutter-generated target as-is):

target 'Runner' do
use_frameworks!
# …flutter_install_all_ios_pods and the rest of the generated target stay here
end

Install CocoaPods Dependencies​

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

Updating to a New Version (iOS)​

After updating the plugin, update the native pods too. pod install alone keeps the native SDK version locked in Podfile.lock:

flutter pub upgrade empower_mobile_ads
cd ios && pod update EmpowerMobileAds empower_mobile_ads && 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>

Configure SKAdNetwork​

Required for production. Ad networks use SKAdNetwork to attribute installs on iOS without tracking the user; if a network's ID isn't listed, it can't attribute conversions, which lowers your fill and revenue. Add an SKAdNetworkItems array to ios/Runner/Info.plist:

<key>SKAdNetworkItems</key>
<array>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>cstr6suwn9.skadnetwork</string>
</dict>
<!-- …all IDs from the AppLovin list -->
</array>

Copy every entry from the AppLovin SKAdNetwork ID list into this array. AppLovin keeps the list up to date and it covers all the demand networks Empower uses, including Google and the mediation adapters. A JSON version is also available. Check the list again before each release so that new IDs are not missed.

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​

On Android the mediation bundle from Add the Mediation Bundle brings every adapter, so there is nothing more to add.

iOS​

Installing the plugin already pulls in Google Mobile Ads, the AppLovin SDK, Google IMA, and Amazon Publisher Services via the native SDK — don't add those yourself. Add the adapter pods for the networks Empower has enabled for your account to your ios/Podfile:

target 'Runner' do
use_frameworks!

# AppLovin MAX adapters
pod 'AppLovinMediationGoogleAdManagerAdapter' # Google Ad Manager
pod 'AppLovinMediationGoogleAdapter' # Google / AdMob bidding
pod 'AppLovinMediationByteDanceAdapter' # Pangle
pod 'AppLovinMediationFacebookAdapter' # Meta Audience Network
pod 'AppLovinMediationFyberAdapter' # DT Exchange (Fyber)
pod 'AppLovinMediationInMobiAdapter' # InMobi
pod 'AppLovinMediationMintegralAdapter' # Mintegral
pod 'AppLovinMediationOguryPresageAdapter' # Ogury
pod 'AppLovinMediationUnityAdsAdapter' # Unity Ads
pod 'AppLovinMediationVungleAdapter' # Liftoff Monetize (Vungle)
pod 'AppLovinMediationYandexAdapter' # Yandex

# Google Mobile Ads (GAM) mediation adapters
pod 'GoogleMobileAdsMediationFacebook' # Meta Audience Network
pod 'GoogleMobileAdsMediationFyber' # DT Exchange (Fyber)
pod 'GoogleMobileAdsMediationInMobi' # InMobi
pod 'GoogleMobileAdsMediationMintegral' # Mintegral
pod 'GoogleMobileAdsMediationPangle' # Pangle
pod 'GoogleMobileAdsMediationUnity' # Unity Ads
pod 'GoogleMobileAdsMediationVungle' # Liftoff Monetize (Vungle)
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 the repositories from Add the Maven Repositories are in android/build.gradle.kts

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 metadata or an incompatible Kotlin version, raise the Kotlin plugin to 2.1.0 or newer as described in Kotlin Version. Do not force kotlin-stdlib to an older version, because the app then crashes at runtime.

Play Console Warns About DEX Code Optimization​

If Play Console shows that DEX code optimization is below the threshold, apply the changes in DEX Code Optimization.

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 ..