This page describes how to set up your development environment to use Glance.
Add the specific Glance dependency in your app's module based on the type of "glanceable" your want to build.
dependencies {
// For AppWidgets support
implementation "androidx.glance:glance-appwidget:1.1.0"
// For interop APIs with Material 3
implementation "androidx.glance:glance-material3:1.1.0"
// For interop APIs with Material 2
implementation "androidx.glance:glance-material:1.1.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.15"
}
kotlinOptions {
jvmTarget = "1.8"
}
}
You can get the latest available version from the Glance release page.