Running in to issue with combination it seems of J...
# compose
j
Running in to issue with combination it seems of Jetpack Compose 1.7.0-beta and CMP 1.6.10. I'm using
HorizontalPager
in shared compose code and am getting
java.lang.NoSuchMethodError: No static method HorizontalPager...
crash. I have to use that 1.7 bera due in turn to dependency on lifecycle 2.8.. I also tried 1.6.20-dev1663 but still get same issue
this is specific crash I'm seeing
Copy code
06-02 09:28:59.102 18848 18848 E AndroidRuntime: java.lang.NoSuchMethodError: No static method HorizontalPager-xYaah8o(Landroidx/compose/foundation/pager/PagerState;Landroidx/compose/ui/Modifier;Landroidx/compose/foundation/layout/PaddingValues;Landroidx/compose/foundation/pager/PageSize;IFLandroidx/compose/ui/Alignment$Vertical;Landroidx/compose/foundation/gestures/snapping/SnapFlingBehavior;ZZLkotlin/jvm/functions/Function1;Landroidx/compose/ui/input/nestedscroll/NestedScrollConnection;Lkotlin/jvm/functions/Function4;Landroidx/compose/runtime/Composer;III)V in class Landroidx/compose/foundation/pager/PagerKt; or its super classes (declaration of 'androidx.compose.foundation.pager.PagerKt' appears in /data/app/~~LCU5wCqVnArSjHNIl8WB1g==/dev.johnoreilly.confetti-Ehh6uoP6VBMVdXCHrU1ZvA==/base.apk)
06-02 09:28:59.102 18848 18848 E AndroidRuntime: 	at dev.johnoreilly.confetti.ui.SessionListGridViewKt.SessionListGridView(SessionListGridView.kt:76)
a
We had pretty much exact crash from including the navigation compose 2.8 beta and had to force the compose runtime version using “force libs.compose.foundation” it seems since it was experimental apis it was subject to changes that were incompatible
i
Running in to issue with combination it seems of Jetpack Compose 1.7.0-beta and CMP 1.6.10
There are some experimental functions that changed between 1.6 and 1.7, so such crashes are expected during such version mixing.
I have to use that 1.7 bera due in turn to dependency on lifecycle 2.8
No, you don't have to. The only problem (only on Android) with Compose 1.6 + lifecycle 2.8 is usage of newly defined
LocalLifecycleOwner
. That used as default parameter in lifecycle library itself. Just pass old one. See https://issuetracker.google.com/336842920#comment8 for details. Also a reflection hack to mitigate situation is on the way. All above is about Android, CMP 1.6.10 works fine in this place.
We had pretty much exact crash from including the navigation compose 2.8 beta and had to force the compose runtime version
No, situation with navigation is different - it's really depends on Compose 1.7. So for multiplatform I have to switch on 2.7.* branch during Compose 1.6.* releases
👍 1
j
So it sounds like it's not recommended to use Jetpack Compose 1.7 beta with CMP?
i
CMP clearly defines compatible versions of Jetpack Compose for each release. So yes, recommendation is to keep them in sync. I understand that you want to try 1.7 features, but it's safer to wait until proper multiplatform adoption. We're working on it
👍 1
а
Hey gents, could you share please which version you chose exactly to fix the NoSuchMethodError?
967 Views