最近,在我的一个项目中,更新到了2024.01.00的最新编写版本,它给了我以下错误.

java.lang.NoSuchMethodError: No virtual method at(Ljava/lang/Object;I)Landroidx/compose/animation/core/KeyframesSpec$KeyframeEntity; in class Landroidx/compose/animation/core/KeyframesSpec$KeyframesSpecConfig; or its super classes (declaration of 'androidx.compose.animation.core.KeyframesSpec$KeyframesSpecConfig' appears in /data/app/~~Sbx7baz2GwMCcVZ6x7z-CA==/com.ai.aso.wallpaper-PqJGZgl7MXHWAf_XL7CGuA==/base.apk)
                                                                                                        at androidx.compose.material3.ProgressIndicatorKt$CircularProgressIndicator$endAngle$1.invoke(ProgressIndicator.kt:371)
                                                                                                        at androidx.compose.material3.ProgressIndicatorKt$CircularProgressIndicator$endAngle$1.invoke(ProgressIndicator.kt:369)
                                                                                                        at androidx.compose.animation.core.AnimationSpecKt.keyframes(AnimationSpec.kt:649)
                                                                                                        at androidx.compose.material3.ProgressIndicatorKt.CircularProgressIndicator-LxG7B9w(ProgressIndicator.kt:369)
                                                                                                        at com.ai.aso.wallpaper.presentation.screens.browse.BrowseScreenKt.BrowseScreen(BrowseScreen.kt:159)
                                                                                                        at com.ai.aso.wallpaper.presentation.screens.home.HomeScreenKt$HomeScreen$3$3$1$1.invoke(HomeScreen.kt:161)
                                                                                                        at com.ai.aso.wallpaper.presentation.screens.home.HomeScreenKt$HomeScreen$3$3$1$1.invoke(HomeScreen.kt:158)
                                                                                                        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:139)
                                                                                                        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35)
                                                                                                        at androidx.compose.foundation.pager.PagerLazyLayoutItemProvider$Item$1.invoke(LazyLayoutPager.kt:199)
                                                                                                        at androidx.compose.foundation.pager.PagerLazyLayoutItemProvider$Item$1.invoke(LazyLayoutPager.kt:197)
                                                                                                        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109)
                                                                                                        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35)
                                                                                                        at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:248)
                                                                                                        at androidx.compose.foundation.lazy.layout.LazyLayoutPinnableItemKt.LazyLayoutPinnableItem(LazyLayoutPinnableItem.kt:58)
                                                                                                        at androidx.compose.foundation.pager.PagerLazyLayoutItemProvider.Item(LazyLayoutPager.kt:197)
                                                                                                        at androidx.compose.foundation.lazy.layout.LazyLayoutItemContentFactoryKt$SkippableItem$1.invoke(LazyLayoutItemContentFactory.kt:135)
                                                                                                        at androidx.compose.foundation.lazy.layout.LazyLayoutItemContentFactoryKt$SkippableItem$1.invoke(LazyLayoutItemContentFactory.kt:134)
                                                                                                        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109)
                                                                                                        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35)
                                                                                                        at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:248)
                                                                                                        at androidx.compose.runtime.saveable.SaveableStateHolderImpl.SaveableStateProvider(SaveableStateHolder.kt:84)
                                                                                                        at androidx.compose.foundation.lazy.layout.LazySaveableStateHolder.SaveableStateProvider(LazySaveableStateHolder.kt:85)
                                                                                                        at androidx.compose.foundation.lazy.layout.LazyLayoutItemContentFactoryKt.SkippableItem-JVlU9Rs(LazyLayoutItemContentFactory.kt:134)
                                                                                                        at androidx.compose.foundation.lazy.layout.LazyLayoutItemContentFactoryKt.access$SkippableItem-JVlU9Rs(LazyLayoutItemContentFactory.kt:1)
                                                                                                        at androidx.compose.foundation.lazy.layout.LazyLayoutItemContentFactory$CachedItemContent$createContentLambda$1.invoke(LazyLayoutItemContentFactory.kt:101)
                                                                                                        at androidx.compose.foundation.lazy.layout.LazyLayoutItemContentFactory$CachedItemContent$createContentLambda$1.invoke(LazyLayoutItemContentFactory.kt:91)
                                                                                                        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109)
                                                                                                        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35)
                                                                                                        at androidx.compose.ui.layout.LayoutNodeSubcompositionsState$subcompose$3$1$1.invoke(SubcomposeLayout.kt:989)
                                                                                                        at androidx.compose.ui.layout.LayoutNodeSubcompositionsState$subcompose$3$1$1.invoke(SubcomposeLayout.kt:476)
2024-01-26 16:05:55.828  8297-8297  AndroidRuntime          com.ai.aso.wallpaper                 E      at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109)
                                                                                                        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35)
                                                                                                        at androidx.compose.runtime.ActualJvm_jvmKt.invokeComposable(ActualJvm.jvm.kt:90)
                                                                                                        at androidx.compose.runtime.ComposerImpl.doCompose(Composer.kt:3302)
                                                                                                        at androidx.compose.runtime.ComposerImpl.composeContent$runtime_release(Composer.kt:3235)
                                                                                                        at androidx.compose.runtime.CompositionImpl.composeContent(Composition.kt:723)
                                                                                                        at androidx.compose.runtime.Recomposer.composeInitial$runtime_release(Recomposer.kt:1071)
                                                                                                        at androidx.compose.runtime.ComposerImpl$CompositionContextImpl.composeInitial$runtime_release(Composer.kt:3599)
                                                                                                        at androidx.compose.runtime.ComposerImpl$CompositionContextImpl.composeInitial$runtime_release(Composer.kt:3599)
                                                                                                        at androidx.compose.runtime.CompositionImpl.composeInitial(Composition.kt:631)
                                                                                                        at androidx.compose.runtime.CompositionImpl.setContent(Composition.kt:617)
                                                                                                        at androidx.compose.ui.layout.LayoutNodeSubcompositionsState.subcomposeInto(SubcomposeLayout.kt:499)
                                                                                                        at androidx.compose.ui.layout.LayoutNodeSubcompositionsState.subcompose(SubcomposeLayout.kt:471)
                                                                                                        at androidx.compose.ui.layout.LayoutNodeSubcompositionsState.subcompose(SubcomposeLayout.kt:462)
                                                                                                        at androidx.compose.ui.layout.LayoutNodeSubcompositionsState.subcompose(SubcomposeLayout.kt:446)
                                                                                                        at androidx.compose.ui.layout.LayoutNodeSubcompositionsState$Scope.subcompose(SubcomposeLayout.kt:871)
                                                                                                        at androidx.compose.foundation.lazy.layout.LazyLayoutMeasureScopeImpl.measure-0kLqBqw(LazyLayoutMeasureScope.kt:125)
                                                                                                        at androidx.compose.foundation.pager.PagerMeasureKt.getAndMeasure-SGf7dI0(PagerMeasure.kt:522)
                                                                                                        at androidx.compose.foundation.pager.PagerMeasureKt.measurePager-_JDW0YA(PagerMeasure.kt:203)
                                                                                                        at androidx.compose.foundation.pager.PagerMeasurePolicyKt$rememberPagerMeasurePolicy$1$1.invoke-0kLqBqw(PagerMeasurePolicy.kt:159)
                                                                                                        at androidx.compose.foundation.pager.PagerMeasurePolicyKt$rememberPagerMeasurePolicy$1$1.invoke(PagerMeasurePolicy.kt:69)
                                                                                                        at androidx.compose.foundation.lazy.layout.LazyLayoutKt$LazyLayout$3$2$1.invoke-0kLqBqw(LazyLayout.kt:107)
                                                                                                        at androidx.compose.foundation.lazy.layout.LazyLayoutKt$LazyLayout$3$2$1.invoke(LazyLayout.kt:100)
                                                                                                        at androidx.compose.ui.layout.LayoutNodeSubcompositionsState$createMeasurePolicy$1.measure-3p2s80s(SubcomposeLayout.kt:708)
                                                                                                        at androidx.compose.ui.node.InnerNodeCoordinator.measure-BRTryo0(InnerNodeCoordinator.kt:126)
                                                                                                        at androidx.compose.foundation.AndroidOverscroll_androidKt$StretchOverscrollNonClippingLayer$2.invoke-3p2s80s(AndroidOverscroll.android.kt:584)
                                                                                                        at androidx.compose.foundation.AndroidOverscroll_androidKt$StretchOverscrollNonClippingLayer$2.invoke(AndroidOverscroll.android.kt:583)

推荐答案

谷歌问题跟踪器上的问题 https://issuetracker.google.com/issues/322214617

由编写团队提供的修复 https://android-review.googlesource.com/c/platform/frameworks/support/+/2928171

暂时使用以下material 3版本

androidx.compose.material3:material3-*:1.2.0-rc01

Android相关问答推荐

如何在Reaction Native中显示Google Map iFrame?

当我在Android上运行应用程序时,组件会随机调整大小和移动

将DiffUtils用于Android上的Recrecerview适配器

为什么我的 APK 中包含来自旧版 Android 支持库的类?

是否可以在 compose 中使用三次贝塞尔曲线进行动画?

如何禁用自动登录 google play games services android unity?

Jetpack Compose的val变量不能被重新分配

Android WebView 不会在滚动端加载新内容

为一组闪烁的可组合项制作动画,控制同步/定时

只能从同一个库组内调用成功(引用groupId=androidx.work from groupId=My Composable)

通知使用默认语言,屏幕显示多种语言,同时通过 AppCompatDelegate 设置应用程序语言

如何在 Delphi 和 Android 上避免 Indy Socket Error #13 Access denied 异常?

Jetpack Compose 部分或开放侧边框

Jetpack Compose 动画性能问题

如何使用 Jetpack Compose 在图像上叠加文本

如何只允许拖动 BottomSheetScaffold 中 BottomContent 的 SheetPeek 的一部分?

Android 自动分页如何与 media3 配合使用?

从expose 的 dropdownMenu 可组合、jetpack 组合中 Select 选项时,不会触发文本字段的 onValueChange

当我更改 ViewModel var 时,Kotlin + Compose 中的 Composable 不会更新

操作系统会终止已启动的服务并调用Service.onDestroy吗?