Is it possible that latest Navigation Compose is m...
# compose
a
Is it possible that latest Navigation Compose is missing a dependency with
activity-compose
? When calling NavHost(…) the app crashs with
java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/activity/compose/LocalOnBackPressedDispatcherOwner;
. I added the following dependency to my project:
Copy code
implementation("androidx.activity:activity-compose:1.3.0-alpha02")
and not it seems to work smoothly
i
You need to add an explicit dependency on
activity-compose:1.3.0-alpha02
to get it working, yes.
🙏 1
a
I thought this was related to a missing dependency inside
navigation-compose
and not much with using libraries compiled with an unstable release of Kotlin (after upgrading project to a stable version). Thanks!
i
It is more that
navigation-compose
depends on the broken
activity-compose:1.3.0-alpha01
. By updating the alpha02, you're using what
navigation-compose
expected all along
Which, in this case, is the existence of the
LocalOnBackPressedDispatcherOwner
and related APIs
👍 2