coreLibraryDesugaringEnabled not working with AGP 8.30

91 Views Asked by At

I recently updated my project to AGP 8.3.0. And since then I am getting errors:

Dependency ':x' requires core library desugaring to be enabled for :y.

I have coreLibraryDesugaring enabled, Groovy:

compileOptions {
        coreLibraryDesugaringEnabled true
    }

I am using com.android.tools:desugar_jdk_libs:2.0.4. All worked before AGP upgrade (8.0.0)

I tried updating desugar lib (this is the latest version), looking for issue on Internet etc

2

There are 2 best solutions below

0
On

I posted issue in Google issue tracker: https://issuetracker.google.com/issues/329346764

The solution seems to be enabling coreLibraryDesugaring in both modules (that was not required before)

1
On

This seems to be an obsolete AGP 4.0 property. According to the documentation, this should be:

compileOptions {

    // For AGP 4.1+
    isCoreLibraryDesugaringEnabled = true
}