google / glance-experimental-tools

Glance Experimental Tools aims to supplement Jetpack Glance with features that are commonly required by developers but not yet available.
https://developer.android.com/jetpack/androidx/releases/glance
Apache License 2.0
167 stars 12 forks source link

java.lang.NoSuchMethodError: No virtual method Content #21

Closed aabadaa closed 3 months ago

aabadaa commented 4 months ago

The exception is being thowed here:

@ExperimentalGlanceRemoteViewsApi private suspend fun GlanceAppWidget.compose( context: Context, size: DpSize, state: Any? ): RemoteViews = glanceRemoteViews.compose( context = context, size = size, state = state, content = { Content() } ).remoteViews

here is my widget: object NoteWidget : GlanceAppWidget() {

override val stateDefinition: GlanceStateDefinition<*> = PreferencesGlanceStateDefinition
override suspend fun provideGlance(context: Context, id: GlanceId) {
    provideContent {
        GlanceTheme(colors =MyAppWidgetGlanceColorScheme.colors) { /* a normal content */ } 
}

}

the exception appears as soon as the user try to add a widget and the configuration activity is launched

Environment:

github-actions[bot] commented 3 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.