PreCompose
PreCompose copied to clipboard
commonMain can't find any package from PreCompose but other modules can
I'm using the official compose multiplatforms template from JetBrains/compose-jb.
commonMain can't find any package from PreCompose, of course, including the classes, and Android Studio marks them red.
However, when I import moe.tlaster.*
in desktopMain, it works.
After researching, I read this issue and speculate it may be because of how you publish this library not an issue of compose multiplatform.
Furthermore, your sample project is using api(project(":precompose"))
, yes I can build and run it, so it doesn't meet this issue.
at common/build.gradle.kts
kotlin {
android()
jvm("desktop")
sourceSets {
named("commonMain") {
dependencies {
api(compose.runtime)
api(compose.foundation)
api(compose.material)
// Needed only for preview.
implementation(compose.preview)
api("moe.tlaster:precompose:1.1.5")
}
}
named("androidMain") {
dependencies {
api("androidx.appcompat:appcompat:1.4.2")
api("androidx.core:core-ktx:1.8.0")
}
}
}
}
Thank you for the link you provided, I'm also facing the same issue but I'm just too busy to find out a solution. I will fix it this week.
Hi, could you please try version 1.2.1? It should fix this issue.
Closing as fixed