I have issue with kotlin 1.4 and android studio 4....
# multiplatform
a
I have issue with kotlin 1.4 and android studio 4.2 canary 8. I added android() target but AS doesn’t see it. androidMain folder is not marked as source set, creating ‘actual’ pop-up is not appeared for android. But, If I try to compile project everything works fine
Copy code
plugins {
    id "org.jetbrains.kotlin.multiplatform"
    id("com.android.library")
}

android {
    compileSdkVersion(29)
    defaultConfig {
        minSdkVersion(19)
        targetSdkVersion(29)
    }
    sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
}

kotlin {

    android()
    iosX64("ios")

}
👆 2
i
I have exactly the same problem, I can see the
androidMain
folder in the
project
view, but not in the
android
view. Starting to think it could be a AS bug...
r
Same here, I suspect AGP rewrites/drops source roots for android
i
Ok think I know what's going on... tried placing my files in
main/src/java
instead of
androidMain/src/kotlin
and it works fine as you can see in the pic. I think it can be redundant to have stuff in
androidMain
, It does makes sense though, might as well use the main folder for Android stuff.
a
@Ivann Ruiz I installed 4.2 canary 9 and it looks like this bug was fixed
👀 1
i
oh really, did you do something else? Mine is still not showing
androidMain
target in
android
view