plugins {
id("com.android.application") version "8.2.1" apply false
id("com.google.dagger.hilt.android") version "2.48" apply false
id("org.jetbrains.kotlin.android") version "1.9.22" apply false
id("com.google.devtools.ksp") version "1.9.22-1.0.16" apply false
}
compileOptions {
isCoreLibraryDesugaringEnabled = true
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
dependencies {
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.4")
}
when changing from
id("com.android.application") version "8.1.1" apply false
to
id("com.android.application") version "8.2.1" apply false
it throws the the error
Multiple build operations failed. coreLibraryDesugaring configuration contains no dependencies. If you intend to enable core library desugaring, please add dependencies to coreLibraryDesugaring configuration. coreLibraryDesugaring configuration contains no dependencies. If you intend to enable core library desugaring, please add dependencies to coreLibraryDesugaring configuration. coreLibraryDesugaring configuration contains no dependencies. If you intend to enable core library desugaring, please add dependencies to coreLibraryDesugaring configuration.
Multiple build operations failed. coreLibraryDesugaring configuration contains no dependencies.
This error usually means you need to add the necessary dependency for core library desugaring. This tool allows you to use Java 8+ features (like lambdas and streams) on older Android versions. Here's how I fixex mine:
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4' // Or the latest version
android {
// ... other configurations
compileOptions {
// Flag to enable support for the new language APIs
coreLibraryDesugaringEnabled true
// Sets Java compatibility to Java 8
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
resources: https://developer.android.com/studio/write/java8-support-table
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With