skip to Main Content

I’m probably missing something obvious but I’m unable to show the Deploy Preview button in my Android Studio.

enter image description here

However if I open the Android Compose Samples I see them.

I checked their dependencies and applied them to my app, but I’m still not able to see them.

implementation "androidx.compose.runtime:runtime:1.1.0-rc01"
implementation "androidx.compose.material:material:1.1.0-rc01"
implementation "androidx.compose.foundation:foundation:1.1.0-rc01"
implementation "androidx.compose.foundation:foundation-layout:1.1.0-rc01"
implementation "androidx.compose.ui:ui-tooling:1.1.0-rc01"
implementation "androidx.compose.animation:animation:1.1.0-rc01"
implementation 'androidx.activity:activity-compose:1.1.0-rc02'
debugImplementation "androidx.compose.ui:ui-test-manifest:1.1.0-rc01"

What am I missing to make this deploy preview show?

Edit

To be clear I’m able show previews no problem.
But no deploy preview button.

enter image description here

Edit 2

I noticed that the button is only appearing in 'com.android.application' modules and not in 'com.android.library' modules ¯_(ツ)_/¯

2

Answers


  1. Chosen as BEST ANSWER

    This behaviour is only visible in an Android library.

    plugins {
        id 'com.android.library'
        ...
    }
    
    android {
        compileSdk 31
    
        defaultConfig {
            minSdk 21
            ... 
    ...
    

    This is a known bug in Android Studio.

    Unfortunately it is not documented anywhere except for this issue.
    It has been fixed in Chipmunk Canary 2


  2. Did you enable it on the experimental panel in AS settings?

    Also, I believe you’re missing the preview dependency
    implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search