Android SDK Installation
Pre-requisites
- Android Studio version
2025.3.3(Panda) or newer - Gradle version
8.2.0or newer - Android 7.0 (API level 24) or newer: set
minSdkto 24 or higher in your app module’s Gradle file - Obtain client settings from Publift:
TENANT_CODETAG_ID- Google
APPLICATION_ID
Installation
- Request access to the Publift Maven repository
- Add the following lines to your
settings.gradlefile:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
repositories {
...
maven { url = uri("https://dl.cloudsmith.io/BrnMk9bbufLlX4Vd/publift/fuseapp/maven/") }
}
}
If you are not using dependencyResolutionManagement in your Gradle configuration, you can add the following line to your build.gradle file:
repositories {
...
maven { url = uri("https://dl.cloudsmith.io/BrnMk9bbufLlX4Vd/publift/fuseapp/maven/") }
}
If your Gradle config is in Kotlin format (the file has .kts extension), then Maven URL setting should be formatted like this:
repositories {
...
maven("https://dl.cloudsmith.io/BrnMk9bbufLlX4Vd/publift/fuseapp/maven/")
}
- Add the following lines to your
build.gradlefile:
dependencies {
implementation 'com.publift.fuseappsdk:fuseappsdk:latest.release'
}
You can find out the latest version of Fuse App SDK here.
- In Android Studio, select the menu item “File > Sync Project With Gradle Files”.
Google Mobile Ads Next-Gen SDK (Optional)
From version 2.7.0, the Fuse App SDK is also published as a build that uses Google’s
Next-Gen Mobile Ads SDK in place of the
legacy Google Mobile Ads SDK. To opt in, replace the fuseappsdk dependency from step 3 with fuseappsdk-next-gen:
dependencies {
implementation 'com.publift.fuseappsdk:fuseappsdk-next-gen:latest.release'
}
You can find out the latest version of the Next-Gen build here.
Use one dependency or the other, not both. Including both Google SDKs in the same app causes duplicate class errors at build time.
The SDK configuration below is the same for both builds. Before switching, check the following:
-
Your own Google Mobile Ads code: If your app calls the Google Mobile Ads SDK directly, migrate that code to the Next-Gen SDK using Google’s migration guide, and remove any
com.google.android.gms:play-services-adsdependency from your app. -
Other libraries: If another library in your app still depends on the legacy Google Mobile Ads SDK, exclude it in your app module’s
build.gradleso that only the Next-Gen SDK is included:configurations.configureEach { exclude group: 'com.google.android.gms', module: 'play-services-ads' exclude group: 'com.google.android.gms', module: 'play-services-ads-lite' exclude group: 'com.google.android.gms', module: 'play-services-ads-api' }If your Gradle file is in Kotlin format (
build.gradle.kts), use the following syntax:configurations.configureEach { exclude(group = "com.google.android.gms", module = "play-services-ads") exclude(group = "com.google.android.gms", module = "play-services-ads-lite") exclude(group = "com.google.android.gms", module = "play-services-ads-api") } -
Native ad handlers: The deprecated
addGamNativeAdHandlerandaddGamCustomNativeAdHandlermethods are not available in the Next-Gen build. Move to the native ads API before switching.
Flutter and React Native apps using plugin version 2.7.0 or newer opt in with the USE_NEXT_GEN_SDK=true flag
instead of changing the dependency. The checks above apply to these apps too.
- Flutter: pass
--dart-define=USE_NEXT_GEN_SDK=trueto everyflutter runandflutter buildcommand, including release and CI builds.google_mobile_adsreads the same flag, so you don’t need to exclude the legacy SDK for that plugin. Any other library that depends on the legacy SDK still needs the exclusion. - React Native: add
USE_NEXT_GEN_SDK=truetoandroid/gradle.properties, then rebuild the Android app.
SDK Configuration
Add the following entries to the file AndroidManifest.xml in your Android project:
<?xml version="1.0" encoding="utf-8"?>
<manifest ... >
<application ... >
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="(PROVIDED-VALUE)" />
<meta-data
android:name="com.publift.mobile.TENANT_CODE"
android:value="(PROVIDED-VALUE)" />
<meta-data
android:name="com.publift.mobile.TAG_ID"
android:value="(PROVIDED-VALUE)" />
...
</application>
</manifest>
The value for each setting wil be provided to you by Publift.
If your app launches using a main Application class, add the following code to it:
import com.publift.fuseappsdk.FuseSDK
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
FuseSDK.init(this)
...
}
}
Alternatively, if your app launches using a main Activity class, add the following code to it:
import com.publift.fuseappsdk.FuseSDK
class MyActivity : ComponentActivity() {
override fun onCreate() {
super.onCreate()
FuseSDK.init(application)
...
}
}