New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Page must be 0 when pageCount is 0" thrown when pageCount > 0 #859
Comments
I saw this happening starting v0.19.0 when a configuration change happened (e.g. language) where during recomposition the Before v0.19.0 |
The workaround for time being:
|
Can you show the crash stacktrace? |
Sorry, Ive switched crash reporting tools since my post and I no longer have access to it. I guess the good news is that I havent seen it since then in a group of 5000 users. Ill let you know if it pops up again! |
I've hit a tangential bug. I can define initialPage to either of my two pages.
If in a launched effect I want to update the initial page or scroll to a page, then I can only do that once the composable has rendered. Which would be the scrollToPage case. This means I can update the initial page once by launched effect completes. |
Never mind, I think I can just move my LaunchedEffect inside to where I have already created the HorizontalPager. |
This is the most common crash on my Compose app, I just started handling it by just checking the page count. @andkulikov I use Firebase Crashlytics so I do have the crash log:
I can send the rest if you want as well. |
@andkulikov PagerState also crashes on version accompanist = "0.17.0"
|
Please try to upgrade to the latest version before reporting any bugs - https://github.com/google/accompanist/releases |
I cant Solve it . Any Solution !! |
@3laeddine-dh Just check the page size before changing the current page:
|
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
After updating to version 0.23.0 issue is still present. |
I am using latest version v0.24.6-alpha , It crashes when I try to scroll to page , even when the content has been rendered completely , and in fact , the page count is always 0
|
I was able to solve this by adding
|
@arbyruns This was fixed by #1195, which is included as of https://github.com/google/accompanist/releases/tag/v0.24.11-rc. If you can update the library, to that version or newer, this is no longer an issue. |
Describe the bug
Scrolling through a HorizontalPager throws this exception in rare cases, Ive seen 3 crash logs in a group of about 1000 users. The pager always shows a fixed list that never changes. I believe the issue is triggered by recompositions happening while scrolling the pager.
Environment:
The text was updated successfully, but these errors were encountered: