Glance setup

This page describes how to set up your development environment to use Glance.

Add Glance dependencies

Add the specific Glance dependency in your app's module based on the features you need:

dependencies {
   // For AppWidgets support
   implementation( "androidx.glance:glance-appwidget:1.0.0" )

   // For interop APIs with Material 2
   implementation( "androidx.glance:glance-material:1.0.0" )

   // For interop APIs with Material 3
   implementation( "androidx.glance:glance-material3:1.0.0" )
}

Activate Compose Compiler

Set the following options to ensure that the compose compiler is available for Glance


android {
   buildFeatures {
      compose true
   }

   composeOptions {
      kotlinCompilerExtensionVersion = "1.5.11"
   }

   kotlinOptions {
      jvmTarget = "1.8"
   }
}


You can get the latest available version from the Glance release page.