Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AppWidget Viewer] NoSuchMethodError: No static method ModalBottomSheetLayout #12

Closed
leinardi opened this issue Aug 25, 2023 · 35 comments · May be fixed by #13
Closed

[AppWidget Viewer] NoSuchMethodError: No static method ModalBottomSheetLayout #12

leinardi opened this issue Aug 25, 2023 · 35 comments · May be fixed by #13
Labels

Comments

@leinardi
Copy link

Describe the bug

The project is currently using outdated version of many dependencies, including Compose and Glance.
This is causing crashes like the following:

 java.lang.NoSuchMethodError: No static method ModalBottomSheetLayout-BzaUkTc(Lkotlin/jvm/functions/Function3;Landroidx/compose/ui/Modifier;Landroidx/compose/material/ModalBottomSheetState;Landroidx/compose/ui/graphics/Shape;FJJJLkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;II)V in class Landroidx/compose/material/ModalBottomSheetKt; or its super classes (declaration of 'androidx.compose.material.ModalBottomSheetKt' appears in /data/app/com.leinardi.ubuntucountdownwidget.debug-1/base.apk)
 	at com.google.android.glance.tools.viewer.ui.ViewerScreenKt.ViewerScreen-_ngmBi8(ViewerScreen.kt:118)
 	at com.google.android.glance.tools.viewer.AppWidgetViewerActivity$onCreate$1$1$1.invoke(GlanceViewerActivity.kt:95)
 	at com.google.android.glance.tools.viewer.AppWidgetViewerActivity$onCreate$1$1$1.invoke(GlanceViewerActivity.kt:94)
 	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:108)
 	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35)
 	at androidx.compose.material3.SurfaceKt$Surface$1.invoke(Surface.kt:133)
 	at androidx.compose.material3.SurfaceKt$Surface$1.invoke(Surface.kt:114)
[...]

To Reproduce

Steps to reproduce the behavior:

  1. Use the viewer library with the latest version of Compose and Material 3.

Expected behavior

The viewer should work as expected

Environment:

  • Android OS version: API 24
  • Device: Emulator
  • Glance Experimental Tools version: 0.2.2

Additional context

I would be happy to work on a PR that bumps the dependencies but, before investing effort on it, I would like to have a confirmation that it would be appreciated and merged if successful.

@github-actions
Copy link

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.

@github-actions github-actions bot added the Stale label Sep 25, 2023
@leinardi
Copy link
Author

comment or this will be closed in 5 days.

@github-actions github-actions bot removed the Stale label Sep 26, 2023
@github-actions
Copy link

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.

@github-actions github-actions bot added the Stale label Oct 27, 2023
@leinardi
Copy link
Author

comment or this will be closed in 5 days.

@github-actions github-actions bot removed the Stale label Oct 28, 2023
Copy link

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.

@github-actions github-actions bot added the Stale label Nov 27, 2023
@leinardi
Copy link
Author

Remove stale label or comment or this will be closed in 5 days.

A fix is getting worked on but isn't released yet: https://issuetracker.google.com/issues/298066147#comment3

@github-actions github-actions bot removed the Stale label Nov 28, 2023
Copy link

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.

@github-actions github-actions bot added the Stale label Dec 29, 2023
@leinardi
Copy link
Author

leinardi commented Jan 1, 2024

comment or this will be closed in 5 days

@github-actions github-actions bot removed the Stale label Jan 2, 2024
Copy link

github-actions bot commented Feb 2, 2024

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.

@github-actions github-actions bot added the Stale label Feb 2, 2024
@leinardi
Copy link
Author

leinardi commented Feb 2, 2024

comment or this will be closed in 5 days

@github-actions github-actions bot removed the Stale label Feb 3, 2024
Copy link

github-actions bot commented Mar 4, 2024

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.

@github-actions github-actions bot added the Stale label Mar 4, 2024
@leinardi
Copy link
Author

leinardi commented Mar 4, 2024

comment or this will be closed in 5 days

@github-actions github-actions bot removed the Stale label Mar 5, 2024
Copy link

github-actions bot commented Apr 4, 2024

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.

@github-actions github-actions bot added the Stale label Apr 4, 2024
@leinardi
Copy link
Author

leinardi commented Apr 4, 2024

comment or this will be closed in 5 days

@github-actions github-actions bot removed the Stale label Apr 5, 2024
Copy link

github-actions bot commented May 6, 2024

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.

@github-actions github-actions bot added the Stale label Jun 6, 2024
@leinardi
Copy link
Author

leinardi commented Jun 6, 2024

I've updated the PR #13 to update to the latest dependencies, would it be possible to review it, merge it and make a new release of the libraries? The artifacts on Maven Central are still very outdated.

@github-actions github-actions bot removed the Stale label Jun 7, 2024
Copy link

github-actions bot commented Jul 8, 2024

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.

@github-actions github-actions bot added the Stale label Jul 8, 2024
@leinardi
Copy link
Author

leinardi commented Jul 8, 2024

comment or this will be closed in 5 days

@github-actions github-actions bot removed the Stale label Jul 9, 2024
@ienground
Copy link

.. and does anyone solve this problem :'(

@leinardi
Copy link
Author

@ienground #13

@ienground
Copy link

still not working :'(

@leinardi
Copy link
Author

do you get the same error java.lang.NoSuchMethodError: No static method ModalBottomSheetLayout?

@ienground
Copy link

when I launch GlancePreviewActivity (implements GlanceViewerActivity), it terminated with message:

FATAL EXCEPTION: main (Ask Gemini)
Process: zone.ien.calarm.debug, PID: 31900
java.lang.NoSuchMethodError: No static method ModalBottomSheetLayout-BzaUkTc(Lkotlin/jvm/functions/Function3;Landroidx/compose/ui/Modifier;Landroidx/compose/material/ModalBottomSheetState;Landroidx/compose/ui/graphics/Shape;FJJJLkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;II)V in class Landroidx/compose/material/ModalBottomSheetKt; or its super classes (declaration of 'androidx.compose.material.ModalBottomSheetKt' appears in /data/app/~~pVUrzfKR-8_D2u7-Lfzplg==/zone.ien.calarm.debug-dskKyv1EuMRGdwqN8mq4_Q==/base.apk) at com.google.android.glance.tools.viewer.ui.ViewerScreenKt.ViewerScreen-_ngmBi8(ViewerScreen.kt:118)
at com.google.android.glance.tools.viewer.AppWidgetViewerActivity$onCreate$1$1$1.invoke(GlanceViewerActivity.kt:95)
...

my activity:

@OptIn(ExperimentalGlanceRemoteViewsApi::class)
class GlancePreviewActivity: GlanceViewerActivity() {
    @ExperimentalGlanceRemoteViewsApi
    override suspend fun getGlanceSnapshot(receiver: Class<out GlanceAppWidgetReceiver>): GlanceSnapshot {
        return when (receiver) {
            AnalogClockWidgetReceiver::class.java -> GlanceSnapshot(
                instance = AnalogClockWidget(),
//                state = mutablePreferencesOf(intPreferencesKey("state") to value)
            )
            else -> throw IllegalArgumentException()
        }
    }

    @ExperimentalGlanceRemoteViewsApi
    override fun getProviders(): List<Class<out AppWidgetProvider>> {
        return listOf(AnalogClockWidgetReceiver::class.java)
    }
}

@leinardi
Copy link
Author

but are you actually using the code from the PR #13 instead of the Maven Central artifact of this library?

@ienground
Copy link

to be honest, your code works only if I add material (compose material2) library.
Without it, It is not compiling.

Copy link

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.

@github-actions github-actions bot added the Stale label Aug 12, 2024
@leinardi
Copy link
Author

comment or this will be closed in 5 days

@github-actions github-actions bot removed the Stale label Aug 13, 2024
Copy link

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.

@github-actions github-actions bot added the Stale label Sep 12, 2024
@ienground
Copy link

.

@github-actions github-actions bot removed the Stale label Sep 13, 2024
Copy link

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.

@github-actions github-actions bot added the Stale label Oct 13, 2024
@WhosNickDoglio
Copy link

Not stale

@github-actions github-actions bot removed the Stale label Oct 14, 2024
Copy link

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.

@KarsonOdette
Copy link

Still not stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants