Status Update
Comments
an...@google.com <an...@google.com> #2
The attached Build Scan log shows that the emulator process crashed unexpectedly. Could you rerun your task with --info
and -Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true
to get more information about the emualtor process logs?
du...@google.com <du...@google.com> #4
No idea why the scan does not contain log information, here you are:
an...@google.com <an...@google.com> #5
The link in --info
and -Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true
, the emulator process output its kernel logging to stdout. Do you see any stacktrace or segfault in the log?
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #6
That's strange, the repo and the build is public... But I attached the logs as file
ki...@protonmail.com <ki...@protonmail.com> #7
I looked into the logs and it turns out, the runner didn't have enough disk space. I guess the root cause is the Gradle update causing another Gradle major version (and its new transform-4) folder to cache was too much. Anyway, a better error message of the exit code of GMD would be helpful.
al...@mercari.com <al...@mercari.com> #8
Thanks for uploading the log! Yes, the emulator kernel log says the issue was the insufficient disk space:
2024-04-02T18:31:45.7078429Z ERROR | Not enough space to create userdata partition. Available: 7177.027344 MB at /home/runner/.config/.android/avd/gradle-managed/dev34_aosp_atd_x86_64_Pixel_2.avd, need 7372.800000 MB.
Also, I agreed that GMD should diagnose errors and can provide better messages.
Let me rename this issue's title to improve the error message for disk space error.
du...@google.com <du...@google.com> #9
I've added a fix that will surface all error messages from the emulator in the exception when it closes unexpectedly.
ha...@gmail.com <ha...@gmail.com> #10
Thank you for your patience while our engineering team worked to resolve this issue. A fix for this issue is now available in:
- Android Studio Meerkat | 2024.3.1 Canary 2
- Android Gradle Plugin 8.9.0-alpha02
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
Thank you for taking the time to submit feedback — we really appreciate it!
ma...@gmail.com <ma...@gmail.com> #11
It might be too late for some people, but if people want to know how to tackle this I've played around with it on a pet project ( didn't test this in a prod environment, so a heads up there ):
@Composable
fun <T : Any> LazyPagingItems<T>.refreshLoadState(): State<LoadState> = produceState<LoadState>(
LoadState.NotLoading(false),
) {
snapshotFlow { loadState }
.drop(1)
.map { it.refresh }
.collect { value = it }
}
cl...@google.com <cl...@google.com> #12
Re
Given the most common use case displays paged data right away, defaulting LoadState to Loading
means the most common use case will not have to drop first LoadState (versus if it were NotLoading).
re...@gmail.com <re...@gmail.com> #13
I don't get how initial state being anything would affect the use case of displaying paged data right away. Wouldn't the LoadState
change before the user has time to notice?
IMHO, initial state being NotLoading
would be the sanest choice. In the case of waiting before starting to load data, the correct state would be shown to the user and in the case of loading data right away, it would immediately change to Loading
, so the correct state would be shown to the user in this case as well.
du...@google.com <du...@google.com>
cl...@google.com <cl...@google.com> #14
Re collectAsLazyPagingItems
compose launches collection on Pager right away. By the time pager.collectAsLazyPagingItems()
returns, data is loading, so initial Loading
is the correct state.
Initializing with NotLoading
also causes other issues (which is why Paging with Views was also refactored to not initialize with NotLoading):
- For users who rely on first
NotLoading
state as indication of refresh complete, they have to manually filter out the firstNotLoading
- If loading animation (i.e. spinners) are based on LoadStates, you could end up seeing a blank screen --> spinner --> data loaded in, and that is not a good user experience.
Description
In Paging 3.1 we made the behavior change to always wait for real
LoadState
updates fromPagingSource
/RemoteMediator
before sending them downstream to user. This allows a developer to react on page loads without needing to filter out the initial / intermediateNotLoading
states. This also prevents sending aCombinedLoadStates
wheremediator
states isnull
even though we are usingRemoteMediator
.Ideally we would not send any "initial" load state downstream, I'm not sure if that means we need to make
.loadState
nullable inLazyPagingItems
as it may not be idiomatic for Compose.Note that this initial state will also end up affecting invalidation, retry, recompose, etc.