Robert Jaros
09/29/2026, 12:49 PMRobert Jaros
09/29/2026, 12:58 PMRobert Jaros
09/29/2026, 1:32 PMRobert Jaros
09/29/2026, 1:39 PMRobert Jaros
09/29/2026, 1:41 PMnamed("androidHostTest") {} block running allTest gives me this error:
Execution failed for task ':modules:kilua-rpc-core:testAndroidHostTest'.
> There are test sources present and no filters are applied, but the test task did not discover any tests to execute. This is likely due to a misconfiguration. Please check your test configuration. If this is not a misconfiguration, this error can be disabled by setting the 'failOnNoDiscoveredTests' property to false.
but running just ./gradlew :modules:kilua-rpc-core:testAndroidHostTest works fine (!)Robert Jaros
09/29/2026, 1:42 PMallTest and single testAndroidHostTest works ok.Robert Jaros
09/29/2026, 1:42 PMRobert Jaros
09/29/2026, 1:46 PMRobert Jaros
09/29/2026, 2:00 PMEugen Martynov
09/29/2026, 5:59 PMOliver.O
09/29/2026, 6:29 PMcom.android.kotlin.multiplatform.library plugin without Robolectric I'd use something like this (untested):
plugins {
id("org.jetbrains.kotlin.multiplatform")
id("com.android.kotlin.multiplatform.library")
id("de.infix.testBalloon")
}
kotlin {
jvm()
android {
namespace = "org.example.android.multiplatform.library"
compileSdk = TODO()
minSdk = TODO()
withHostTestBuilder {}.configure {
// isIncludeAndroidResources = true
}
withDeviceTestBuilder {
sourceSetTreeName = "test"
}.configure {
managedDevices {
localDevices {
@Suppress("UnstableApiUsage")
create("pixel2api30") {
device = "Pixel 2"
apiLevel = 30
systemImageSource = "aosp"
}
}
}
}
}
sourceSets {
commonTest {
dependencies {
implementation("de.infix.testBalloon:testBalloon-framework-core:${testBalloonVersion}")
}
}
named("androidHostTest") {
dependencies {
implementation("de.infix.testBalloon:testBalloon-framework-core:${testBalloonVersion}")
implementation(libs.junit.junit4)
implementation(libs.androidx.test.core)
}
}
named("androidDeviceTest") {
dependencies {
implementation("de.infix.testBalloon:testBalloon-framework-core:${testBalloonVersion}")
implementation(libs.androidx.test.runner)
}
}
}
}
The Android-related docs are here: developer.android.com/kotlin/multiplatform/plugin
I agree that it's somewhat involved, but AGP does not appear stable enough to offer the kind of auto-configuration TestBalloon does for other targets.
If that doesn't work, please point me to a branch in your repo where I could try to set it up.Eugen Martynov
09/29/2026, 6:31 PMOliver.O
09/29/2026, 8:56 PMandroidx.test.core is optional:
developer.android.com/reference/kotlin/androidx/test/core/app/package-summaryRobert Jaros
09/30/2026, 4:18 AMtestBalloon-framework-core to all source sets intentional? Shouldn't commonTest be enough?Oliver.O
09/30/2026, 9:05 AMcom.android.kotlin.multiplatform.library plugin, that's correct. At some point in the evolution from AGP 8 to AGP 9, not all source sets were connected to the common parents.
This should be the required minimum:
sourceSets {
commonTest {
dependencies {
implementation("de.infix.testBalloon:testBalloon-framework-core:${testBalloonVersion}")
}
}
named("androidHostTest") {
dependencies {
implementation(libs.junit.junit4)
}
}
named("androidDeviceTest") {
dependencies {
implementation(libs.androidx.test.runner)
}
}
}