I migrated Android library modules to Kotlin Multi...
# multiplatform
l
I migrated Android library modules to Kotlin Multiplatform gradle module, and now, the tests in
androidTest
are run as unit tests without instrumentation, making them fail (they are run on the computer without Android OS with no option to run it from an Android device/emulator). Where should I put my instrumented tests, or how should I configure my module to get instrumentation back?
k
In order to have instrumented tests, you need to have an app target (apk). you can't run a library
1
b
You have to set the sourcesets, as test sets
l
Which source sets? How? Is there an example?
y
something like this
Copy code
android {
  // min sdk and other android config
  sourceSets {
    androidTest.java.srcDirs += 'src/androidTest/kotlin'
  }
}
l
Oh, that perfectly makes sense now! AGP still doesn't handle
kotlin
dir by default, and I removed it in the process of migrating to Kotlin multiplatform plugin. Thanks for the hint!
b
Welcome, sorry for the delay @louiscad. Thanks @yshrsmz
l
No worries 🙂