disable desugaring as it breaks sdk <24

This commit is contained in:
C10udburst 2022-08-10 21:36:59 +02:00
parent a6a5597c28
commit 3b9c8706d9

View file

@ -37,15 +37,17 @@ abstract class CompileDexTask : DefaultTask() {
fun compileDex() {
val android = project.extensions.getByName("android") as BaseExtension
val minSdk = android.defaultConfig.minSdk ?: 21
val dexOutputDir = outputFile.get().asFile.parentFile
Closer.create().use { closer ->
val dexBuilder = DexArchiveBuilder.createD8DexBuilder(
DexParameters(
minSdkVersion = android.defaultConfig.maxSdkVersion ?: 24,
minSdkVersion = minSdk,
debuggable = true,
dexPerClass = false,
withDesugaring = true,
withDesugaring = minSdk >= 24,
desugarBootclasspath = ClassFileProviderFactory(android.bootClasspath.map(File::toPath))
.also { closer.register(it) },
desugarClasspath = ClassFileProviderFactory(listOf<Path>()).also { closer.register(it) },