Skip to main content

Resolving Android minApiVersion < 26 Issue in GoogleAds Identifier 18.2.0

info

Android API < 26 does not support Java 8 language features by default, such as java.time.Duration, etc. On some Android API < 26 firmware, this may lead to NoClassDefFoundError. More info here.

If your app supports minApiVersion < 26, you need to enable core library desugaring in your launcherTemplate.gradle:

  1. Add flag Custom Launcher Gradle Template under Build Settings → Player Settings → Publishing settings:

  2. Add the following lines to your launcherTemplate.gradle file:

    • com.android.tools:desugar_jdk_libs in dependencies block
    • coreLibraryDesugaringEnabled true in android > compileOptions block
dependencies {
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:2.1.5"
}

android {
compileOptions {
coreLibraryDesugaringEnabled true
}
}