louiscad
09/12/2020, 11:31 AMThe Kotlin source set androidAndroidTestRelease was configured but not added to any Kotlin compilation. You can add a source set to a target's compilation by connecting it with the compilation's default source set using 'dependsOn'.
See <https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#connecting-source-sets>
zalewski.se
09/13/2020, 12:48 PMsourceSet
as I couldn’t add it to the compilation. To remove it you can just do:
android {
sourceSets.remove(sourceSets.getByName("androidAndroidTestRelease"))
}
Logs are gone on my side after this. I don’t think it’s anyhow perfect but since it’s not added to any compilation, shouldn’t make a difference when you remove it.louiscad
09/13/2020, 12:53 PMzalewski.se
09/13/2020, 12:55 PMandroidAndroidTestDebug
sourceSet to depends on androidAndroidTestRelease
ones, apparently then it’s being added to the compilation. Like:
android {
sourceSets.getByName("androidAndroidTestDebug").dependsOn(sourceSets.getByName("androidAndroidTestRelease"))
}
or
val androidAndroidTestRelease by getting
val androidAndroidTestDebug by getting {
dependsOn(androidAndroidTestRelease)
}
louiscad
09/13/2020, 5:46 PMbuild.gradle.kts
file:
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
// buildscript and plugins block
allprojects {
afterEvaluate {
project.extensions.findByType<KotlinMultiplatformExtension>()?.let { kmpExt ->
kmpExt.sourceSets.removeAll { it.name == "androidAndroidTestRelease" }
}
}
}
It wouldn't work if I didn't use afterEvaluate
but tried to use plugins.withType
+ configureEach
.