leavesCZY / Matisse

A Image/Video Selector Implemented with Jetpack Compose(一个用 Jetpack Compose 实现的 Android 图片视频选择框架)
https://github.com/leavesCZY/Matisse/wiki
Apache License 2.0
768 stars 60 forks source link

选择图片后crash #17

Closed LZRight123 closed 1 year ago

LZRight123 commented 1 year ago

implementation platform('androidx.compose:compose-bom:2023.04.01') 时 MatissePreviewPage 里使用了 val pagerState = rememberPagerState(initialPage = initialPage) 这个方法已经更新了

@ExperimentalFoundationApi @Composable fun rememberPagerState( initialPage: Int = 0, initialPageOffsetFraction: Float = 0f, pageCount: () -> Int ): PagerState

报错如下

java.lang.NoSuchMethodError: No static method HorizontalPager-AlbwjTQ(ILandroidx/compose/ui/Modifier;Landroidx/compose/foundation/pager/PagerState;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/Function3;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/com.fantasy.naduo-lujl7-vPnSPpHzhg7xp-Ow==/base.apk)
leavesCZY commented 1 year ago

@LZRight123 目前 HorizontalPager 的新实现还未发布正式版,还只是处于 beta 阶段。即使是当前最新的 06.00,Matisse 也还是可以正常使用的。你应该是导入了其它 compose 依赖,导致你的 compose.foundation 版本过高

1686280008564

LZRight123 commented 1 year ago

谢谢 明白了