Alper Tekin
06/08/2022, 6:00 PMactual
class.
I do follow the example in KaMPKit. Although everything works fine in KaMPKit standalone project, in my project which is a separate project and implements shared lib can not resolve actual
class imports in androidMain
but resolves iosMain
😄 Any thoughts about what the reason might be? Thanks in advance.mkrussel
06/08/2022, 6:40 PMandroidMain
you mean the Kotlin source set called androidMain
or a directory called androidMain
.
If you mean the directory, then the problem maybe caused by the default behavior for android target. Android in KMM defaults to using the directories main
and test
for where to look for their source files. Many people add androidMain
directory to the androidMain
source set to make Android follow patterns of the other platforms.mkrussel
06/08/2022, 6:42 PMmkrussel
06/08/2022, 6:48 PMandroidMain/Kotlin
directory as a source root.Alper Tekin
06/08/2022, 7:49 PMandroidMain
below points to the source set
sourceSets {
val androidMain by getting {
To clarify; I reach shared
source code through my app project and nothing seems to be resolved in androidMain
directory in shared lib.
By the way, see the screenshot. It looks like that in the shared lib project. So, main
might be a problem here I guess.Kwabena Berko
06/09/2022, 10:31 AMAlper Tekin
06/17/2022, 4:41 PMandroid {
sourceSets {
getByName("main") { java.srcDir("src/androidMain/kotlin")
}
}
}