Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple build operations failed. Android error

 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.

like image 916
Ravi Sorathiya Avatar asked May 15 '26 15:05

Ravi Sorathiya


1 Answers

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:

  1. Add the Dependency: Open your module-level build.gradle file (usually app/build.gradle) and add the following dependency to the dependencies block:
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4' // Or the latest version
  1. Enable Java 8 Compatibility: In the same file, within the android block, make sure Java 8 compatibility is enabled:
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
           }
       }
  1. Sync Gradle
  2. Clean and Rebuild

resources: https://developer.android.com/studio/write/java8-support-table

like image 57
Omar Khaled Avatar answered May 17 '26 06:05

Omar Khaled



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!