Dumb question. With this simple kotlin-mpp templat...
# multiplatform
f
Dumb question. With this simple kotlin-mpp template https://github.com/shadowsheep1/kotlin-mpp-playground if I switch to Android visualisation I cannot see
androidMain
and
androidTest
folders. Any ideas of the reason I cannot see them?
s
I cannot tell right now, if this is a known issue. My Gut feeling would tell me, that Android View is not yet supported, because Kotlin Mpp source sets are not registered in Android Source Sets. I might try this out using one of those two PR’s https://github.com/JetBrains/kotlin/pull/2811 https://github.com/JetBrains/kotlin/pull/2829 to see if they fix this issue ☺️
f
Thanks @Sebastian Sellmair [JB] I'll look at your PR's too!
k
do you have
androidMain
and
androidTest
configured as source sets for the Android plugin?
f
Uhm @Kris Wong this is all I have https://github.com/shadowsheep1/kotlin-mpp-playground/blob/master/kotlin-mpp/build.gradle.kts. So I guess I'm missing something... Do I need to add an additional sourceSet section?
k
Copy code
android {
    compileSdkVersion(28)
    defaultConfig {
        minSdkVersion(19)
        targetSdkVersion(28)
        versionCode = 1
        versionName = "0.1"
        testInstrumentationRunner = "android.support.test.runner.AndroidJUnitRunner"
    }
    sourceSets {
        getByName("main") {
            manifest.srcFile("src/androidMain/AndroidManifest.xml")
            java.srcDirs("src/androidMain/kotlin")
            res.srcDirs("src/androidMain/res")
        }
        getByName("test") {
            java.srcDirs("src/androidTest/kotlin")
            res.srcDirs("src/androidTest/res")
        }
    }
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }
    testOptions.unitTests.isIncludeAndroidResources = true
}
f
Let me try it
Remapping android source sets this way it kinda works, but I still cannot see test folder. Anyway thanks @Kris Wong 'cause I've learned something new.
Ops... I see instead! It's the highlighted line
Thanks a lot @Kris Wong
🍻 1