java.lang.NoSuchMethodError:

  FATAL EXCEPTION: main
                                                                                                    Process: co.haive.test, PID: 3962
                                                                                                    java.lang.NoSuchMethodError: No static method rememberInfiniteTransition(Ljava/lang/String;Landroidx/compose/runtime/Composer;II)Landroidx/compose/animation/core/InfiniteTransition; in class Landroidx/compose/animation/core/InfiniteTransitionKt; or its super classes (declaration of 'androidx.compose.animation.core.InfiniteTransitionKt' appears in /data/app/~~_pVH61dywlhelNILin2Ajw==/co.haive.test-xmgnI9wJ3y0VF91e0jFfAA==/base.apk)
                                                                                                        at co.haive.lib.common.v2.ui.material.ProgressKt.ResponseLoadingBox(Progress.kt:71)
                                                                                                        at co.haive.lib.common.v2.ui.material.ProgressKt.HaiveNetResponseScene(Progress.kt:56)
                                                                                                        at co.haive.user.v2.ui.welcome.WelcomeActivityKt.WelcomeCheckBindReferralScene-au3_HiA(WelcomeActivity.kt:436)
                                                                                                        at co.haive.user.v2.ui.welcome.WelcomeActivityKt.access$WelcomeCheckBindReferralScene-au3_HiA(WelcomeActivity.kt:1)
                                                                                                        at co.haive.user.v2.ui.welcome.WelcomeActivityKt$WelcomeCheckBindReferralScene$1.invoke(Unknown Source:25)
                                                                                                        at co.haive.user.v2.ui.welcome.WelcomeActivityKt$WelcomeCheckBindReferralScene$1.invoke(Unknown Source:10)
                                                                                                        at androidx.compose.runtime.RecomposeScopeImpl.compose(RecomposeScopeImpl.kt:162)
                                                                                                        at androidx.compose.runtime.ComposerImpl.recomposeToGroupEnd(Composer.kt:2443)
                                                                                                        at androidx.compose.runtime.ComposerImpl.skipCurrentGroup(Composer.kt:2711)
                                                                                                        at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:3342)
                                                                                                        at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:3320)
                                                                                                        at androidx.compose.runtime.SnapshotStateKt__DerivedStateKt.observeDerivedStateRecalculations(DerivedState.kt:341)
                                                                                                        at androidx.compose.runtime.SnapshotStateKt.observeDerivedStateRecalculations(Unknown Source:1)
                                                                                                        at androidx.compose.runtime.ComposerImpl.doCompose(Composer.kt:3320)
                                                                                                        at androidx.compose.runtime.ComposerImpl.recompose$runtime_release(Composer.kt:3285)
                                                                                                        at androidx.compose.runtime.CompositionImpl.recompose(Composition.kt:772)
                                                                                                        at androidx.compose.runtime.Recomposer.performRecompose(Recomposer.kt :1047)
                                                                                                        at androidx.compose.runtime.Recomposer.access$performRecompose(Recomposer.kt:124)
                                                                                                        at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$2.invoke(Recomposer.kt:541)
                                                                                                        at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$2.invoke(Recomposer.kt:510)
                                                                                                        at androidx.compose.ui.platform.AndroidUiFrameClock$withFrameNanos$2$callback$1.doFrame(AndroidUiFrameClock.android.kt:34)
                                                                                                        at androidx.compose.ui.platform.AndroidUiDispatcher.performFrameDispatch(AndroidUiDispatcher.android.kt:109)
                                                                                                        at androidx.compose.ui.platform.AndroidUiDispatcher.access$performFrameDispatch(AndroidUiDispatcher.android.kt:41)
                                                                                                        at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.doFrame(AndroidUiDispatcher.android.kt:69)
                                                                                                        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1216)
                                                                                                        at android.view.Choreographer.doCallbacks(Choreographer.java:972)
                                                                                                        at android.view.ChoreographerExtImpl.checkScrollOptSceneEnable(ChoreographerExtImpl.java:319)
                                                                                                        at android.view.Choreographer.doFrame(Choreographer.java:859)
                                                                                                        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1203)
                                                                                                        at android.os.Handler.handleCallback(Handler.java:938)
                                                                                                        at android.os.Handler.dispatchMessage(Handler.java:99)
                                                                                                        at android.os.Looper.loopOnce(Looper.java:233)
                                                                                                        at android.os.Looper.loop(Looper.java:344)
                                                                                                        at android.app.ActivityThread.main(ActivityThread.java:8205)
                                                                                                        at java.lang.reflect.Method.invoke(Native Method)
                                                                                                        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:589)
                                                                                                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1071)
                                                                                                        Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [androidx.compose.runtime.PausableMonotonicFrameClock@cd2e382, androidx.compose.ui

Judging from the error log, your project encountered one at runtime java.lang.NoClassDefFoundError. This error indicates that the project cannot find the class at runtime androidx.compose.animation.AnimatedContentScope.

There are several possible reasons for this problem:

  1. Dependencies are not properly configured. Please check your project's build.gradlefiles to make sure you have addedandroidx.compose.animat
        api 'androidx.compose.animation:animation:1.4.1'
        api 'androidx.compose.animation:animation-core:1.4.1'
        api 'androidx.compose.animation:animation-graphics:1.4.1'
  1. Dependency conflict. If your project uses multiple libraries and they depend on different versions of androidx.compose.animationthe libraries, it may cause dependency conflicts. You can build.gradlework around this by forcing a specific version of the library in the file. For example:

Configuration under the Android node

    configurations.configureEach {
        resolutionStrategy {
            force 'androidx.compose.animation:animation:1.4.1' // 使用合适的版本
            force 'androidx.compose.animation:animation-core:1.4.1'
            force 'androidx.compose.animation:animation-graphics:1.4.1'
        }
    }

Guess you like

Origin blog.csdn.net/mp624183768/article/details/130261069