If I'm using Jetbrains Compose in a multiplatform ...
# compose
e
If I'm using Jetbrains Compose in a multiplatform project and have an Android target, should I still set
buildFeatures.compose = true
in my
build.gradle.kts
? If I don't set it, the IDE doesn't recognize files with compose in them, and doesn't show the preview window. If I do set it the preview window shows, but if I use certain composables the preview (and running the app) breaks with a
NoSuchMethodError
. For example if my composable has a
Text
, it fails with:
Copy code
java.lang.NoSuchMethodError: 'void androidx.compose.material3.TextKt.Text-nZBYWUE(java.lang.String, androidx.compose.ui.Modifier, long, long, androidx.compose.ui.text.font.FontStyle, androidx.compose.ui.text.font.FontWeight, androidx.compose.ui.text.font.FontFamily, long, androidx.compose.ui.text.style.TextDecoration, androidx.compose.ui.text.style.TextAlign, long, int, boolean, int, int, _layoutlib_._internal_.kotlin.jvm.functions.Function1, androidx.compose.ui.text.TextStyle, androidx.compose.runtime.Composer, int, int, int)'