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 minApiVersion < 26, you need to enable core library desugaring — AGP ≥ 4.0 desugars Java 8 API in your build.gradle module level:

android {
// ... other project settings
compileOptions {
isCoreLibraryDesugaringEnabled = true
}
}

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