Android SDK Installation

Pre-requisites

  1. Android Studio version 2025.3.3 (Panda) or newer
  2. Gradle version 8.2.0 or newer
  3. Android 7.0 (API level 24) or newer: set minSdk to 24 or higher in your app module’s Gradle file
  4. Obtain client settings from Publift:
    • TENANT_CODE
    • TAG_ID
    • Google APPLICATION_ID

Installation

  1. Request access to the Publift Maven repository
  2. Add the following lines to your settings.gradle file:
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/")
}
  1. Add the following lines to your build.gradle file:
dependencies {
    implementation 'com.publift.fuseappsdk:fuseappsdk:latest.release'
}

You can find out the latest version of Fuse App SDK here.

  1. 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-ads dependency 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.gradle so 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 addGamNativeAdHandler and addGamCustomNativeAdHandler methods 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=true to every flutter run and flutter build command, including release and CI builds. google_mobile_ads reads 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=true to android/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)
        ...
    }

}