Tlaster / PreCompose

Compose Multiplatform Navigation && State Management
https://tlaster.github.io/PreCompose/
MIT License
867 stars 50 forks source link

[BUG] java.lang.NoSuchMethodError: No direct method <init>(Ljava/lang/Object;Ljava/lang/Object;)V in class Landroidx/compose/animation/core/SeekableTransitionState; #349

Open FunkyMuse opened 4 months ago

FunkyMuse commented 4 months ago

Describe the bug When going back from a destination (scene) the app crashes with

To Reproduce Use Compose multiplatform 1.7.X-alpha or dev navigate from a destination, go back crash, not always

Expected behavior User should be returned to the destination safely

Minimal reproducible example I guess that's something introduced in 1.7.X Compose multiplatform that breaks the library

stack trace is

java.lang.NoSuchMethodError: No direct method <init>(Ljava/lang/Object;Ljava/lang/Object;)V in class Landroidx/compose/animation/core/SeekableTransitionState; or its super classes (declaration of 'androidx.compose.animation.core.SeekableTransitionState' appears in /data/app/~~49ENzoh7ld7afOHMt_9WzA==/com.x.x.debug-AIZoxjVS9E177qpLp0l5xQ==/base.apk)
                                                                                                        at moe.tlaster.precompose.navigation.NavHostKt$NavHost$6.invoke(NavHost.kt:191)
                                                                                                        at moe.tlaster.precompose.navigation.NavHostKt$NavHost$6.invoke(NavHost.kt:140)
Tlaster commented 4 months ago

Yes compose 1.7.x change the SeekableTransitionState's API, which I will update to use the new version after 1.7.x has been released.

FunkyMuse commented 3 months ago

Yes compose 1.7.x change the SeekableTransitionState's API, which I will update to use the new version after 1.7.x has been released.

1.7.X is in alpha now, maybe a PreCompose alpha/beta release too?

emirhanemmez commented 2 months ago

it would be great if you fix that bug :) thanks for your effort

mobiletoly commented 2 months ago

any news on having it fixed? and thank you for a great library!

Tlaster commented 1 month ago

PreCompose 1.7.0-alpha01 is out with compose multiplatform 1.7.0-beta02 support, which should resolve the issue.

mobiletoly commented 1 month ago

I saw that precompose 1.7.0-alpha02 was released, but after adding it - I'm getting error:

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':composeApp:transformNativeMainCInteropDependenciesMetadataForIde'.
> Could not resolve all files for configuration ':composeApp:nativeMainResolvableDependenciesMetadata'.
   > Could not find moe.tlaster:precompose-viewmodel:1.7.0-alpha02.
     Required by:
         project :composeApp
   > Could not find moe.tlaster:precompose-koin:1.7.0-alpha02.
     Required by:
         project :composeApp

I don't have the same issue is with 1.7.0-alpha01

Tlaster commented 1 month ago

I saw that precompose 1.7.0-alpha02 was released, but after adding it - I'm getting error:

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':composeApp:transformNativeMainCInteropDependenciesMetadataForIde'.
> Could not resolve all files for configuration ':composeApp:nativeMainResolvableDependenciesMetadata'.
   > Could not find moe.tlaster:precompose-viewmodel:1.7.0-alpha02.
     Required by:
         project :composeApp
   > Could not find moe.tlaster:precompose-koin:1.7.0-alpha02.
     Required by:
         project :composeApp

I don't have the same issue is with 1.7.0-alpha01

moe.tlaster:precompose-viewmodel is no longer used and replaced by org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-compose, this is a major change for 1.7.0-alpha02, you can still keep 1.7.0-alpha01 if you're not ready to migrate to Jetpack's ViewModel. https://github.com/Tlaster/PreCompose/releases/tag/1.7.0-alpha02

mobiletoly commented 1 month ago

oh OK, thank you, completely forgot to take a look at release notes. luckily for me migration should be pretty straightforward, especially because I recently discovered that PreCompose/Molecule is in most cases better choice for me than using ViewModel approach.

andrearossini-bf commented 2 weeks ago

Does 1.7.0-alpha03 work on iOS? Because for me it causes a crash at startup. I used 03 because I read that it contains iOS fixes.

misskbar commented 1 week ago

Any updates with this issue?

andrearossini-bf commented 1 week ago

Yes actually it works, mine was just some other plugins' conflict. I suggest to verify carefully all plugins' compatibility, eventually disabling and reintegrating them gradually.