Colton Idle

10/29/2021, 4:39 AM
I'm going back into my old projects and trying to add @Preview since I was able to get it to work now in plain old Android Compose projects. But now I have a jetbrains compose project, and I have an
folder that I'd like to be able to use @Preview. Then in my commoncomposables module build.gradle.kts I have
named("androidMain") {
  dependencies {
But as you can see, the IDE doesn't give me the code/design/split pane. Does anyone know if I should be able to see that pane so I can have previews without deploying to device? Note: I don't care about previewing my desktop composables or anything, I just want my androidMain folder to be able to preview as you would in a normal android compose app.
What I'm looking for is being able to see this in AS, but I don't


10/29/2021, 9:20 AM
preview only works in jvmMain and/or androidMain
there is a open issue about this one in compose-jb
in other words, you have to set the function which has the @Preview inside jvmMain and/or androidMain

Colton Idle

10/29/2021, 2:08 PM
Yeah. I'm in androidMain, but that's not working.
Repro'd it not working in the jb compose template

Chris Sinco [G]

11/03/2021, 2:15 AM
If you are using IntelliJ, I’m not sure the same split view is available since that is specifically implemented that way for design tools in Android Studio
If you are using AS, I don’t know if the project structure is supported which maybe is why it’s not showing up. If you have a link to an example project, we can take a look on the Studio side
@nosuid might have more insight

Colton Idle

11/03/2021, 2:37 AM
Yeah, I have a sample (which just so happens to be the multiplatform-template in the jb compose repo. Created an issue here: