Status Update
Comments
jo...@meterapp.co <jo...@meterapp.co> #2
Branch: androidx-master-dev
commit b90079595f33f58fece04026a97faa0d243acdb1
Author: Yuichi Araki <yaraki@google.com>
Date: Wed Sep 18 16:55:49 2019
Change the way to detect mismatch between POJO and query
This fixes cursor mismatch warnings with expandProjection.
Bug: 140759491
Test: QueryMethodProcessorTest
Change-Id: I7659002e5e0d1ef60fc1af2a625c0c36da0664d8
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
M room/compiler/src/test/kotlin/androidx/room/processor/QueryMethodProcessorTest.kt
M room/compiler/src/test/kotlin/androidx/room/testing/TestProcessor.kt
jo...@meterapp.co <jo...@meterapp.co> #3
bi...@gmail.com <bi...@gmail.com> #4
Branch: androidx-master-dev
commit bdde5a1a970ddc9007b28de4aa29d60ffa588f08
Author: Yigit Boyar <yboyar@google.com>
Date: Thu Apr 16 16:47:05 2020
Re-factor how errors are dismissed when query is re-written
This CL changes how we handle errors/warnings if query is
re-written.
There was a bug in expandProjection where we would report warnings
for things that Room already fixes automatically (
The solution to that problem (I7659002e5e0d1ef60fc1af2a625c0c36da0664d8)
solved it by deferring validating of columns until after re-write
decision is made. Unfortunately, this required changing PojoRowAdapter
to have a dummy mapping until it is validating, make it hard to use
as it does have a non-null mapping which is not useful.
This CL partially reverts that change and instead rely on the log
deferring logic we have in Context. This way, we don't need to break
the stability of PojoRowAdapter while still having the ability to
drop warnings that room fixes. This will also play nicer when we
have different query re-writing options that can use more information
about the query results.
Bug: 153387066
Bug: 140759491
Test: existing tests pass
Change-Id: I2ec967c763d33d7a3ff02c1a13c6953b460d1e5f
M room/compiler/src/main/kotlin/androidx/room/log/RLog.kt
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
[Deleted User] <[Deleted User]> #5
In our case, to reproduce the crash, we press simultaneously the Action Bar back arrow (navController::navigateUp) AND the hardware back button.
This way we get the stacktrace:
java.lang.ArrayIndexOutOfBoundsException: length=10; index=-1
at java.util.ArrayList.get(ArrayList.java:439)
at androidx.navigation.compose.NavHostKt$NavHost$25$1.invokeSuspend(NavHost.kt:518)
- navigation-compose 2.8.3
- activity-compose 1.9.3
- Android 12 (API 31)
8h...@gmail.com <8h...@gmail.com> #6
as I understand it doesn't happen with androidxNavigation = "2.7.7"
version or lower, so let's not updated it until it's fixes
jo...@meterapp.co <jo...@meterapp.co> #7
as I understand it doesn't happen with androidxNavigation = "2.7.7" version or lower, so let's not updated it until it's fixes
Yes this is correct, unfortunately I'm past the point of no return because I migrated my app to type safe navigation APIs, it would be very unfortunate to migrate back because this crash is not resolved. Does anyone know why this issue has not been assigned to anyone? It seems like a huge, top voted, issue.
pa...@wewell.app <pa...@wewell.app> #8
I confirm reverting to 2.7.7
fixes the issue. I'm not happy at all with this solution, I had to revert also Compose Destinations and Koin... Could we please get a proper fix?
jb...@google.com <jb...@google.com>
ap...@google.com <ap...@google.com> #9
Project: platform/frameworks/support
Branch: androidx-main
Author: Jeremy Woods <
Link:
Add conditional check inside NavHost PredictiveBackHandler
Expand for full commit details
Add conditional check inside NavHost PredictiveBackHandler
There is no way to guarantee that we will get a composition if a state
change and back callback get triggered in the same frame. This can
result in triggering the `PredictiveBackHandler`'s callback even though
it should actually be disabled.
The cleaner options of fixing this are to change the
`PredictiveBackHandler`'s `enabled` parameter to a Boolean producing
lambda that can be executed internally and retrieve the current value,
but that needs a new API. (see 379152996#comment2)
In the meantime, we just need to add the same check inside of the
`PredictiveBackHandler`'s lambda.
RelNote: "Fixed an issue where `NavHost` could throw an exception
inside of the `PredictiveBackHandler` if the back stack is popped down
to 1 entry and a system back are triggered in the same frame."
Test: added testDisabledInSameFramePredictiveBack
Bug: 375343407
Change-Id: I1a4297a10f2d0da8c8477644b9250c61e4792923
Files:
- M
navigation/navigation-compose/src/androidTest/java/androidx/navigation/compose/NavHostPredictiveBackTest.kt
- M
navigation/navigation-compose/src/main/java/androidx/navigation/compose/NavHost.kt
Hash: f724837c72814a08c4177004ae3e8f380eea8367
Date: Fri Nov 15 20:56:54 2024
[Deleted User] <[Deleted User]> #10
jb...@google.com <jb...@google.com> #11
This has ben fixed internally and will be available in the Navigation 2.8.5
release.
jo...@meterapp.co <jo...@meterapp.co> #12
Thank you so much for your hard work and persistence on this issue! Really excited for the 2.8.5 release :)
sh...@navi.com <sh...@navi.com> #13
by when can i expect 2.8.5 to hit stable and be available to use?
jo...@meterapp.co <jo...@meterapp.co> #14
by when can i expect 2.8.5 to hit stable and be available to use?
Based on the androidx release schedule, I'd assume it will be available December 11th. It looks like they skipped the thanksgiving release for most libraries and I'm hoping they'll be back with releases December 11th.
pr...@google.com <pr...@google.com> #15
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.navigation:navigation-compose:2.9.0-alpha04
androidx.navigation:navigation-compose:2.8.5
si...@gmail.com <si...@gmail.com> #16
I can confirm that our usual way of reproducing this issue with the debugger no longer crashes. Thanks a lot for this release!
sa...@gmail.com <sa...@gmail.com> #17
ma...@wm.rs <ma...@wm.rs> #18
Hi, I'm still facing the issue with 2.8.5
The stack trace:
Fatal Exception: java.lang.IndexOutOfBoundsException: Index -1 out of bounds for length 1
at jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
at jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
at jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266)
at java.util.Objects.checkIndex(Objects.java:359)
at java.util.ArrayList.get(ArrayList.java:434)
at androidx.navigation.compose.NavHostKt$NavHost$28$1.invokeSuspend(NavHost.kt:620)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:101)
at androidx.compose.ui.platform.AndroidUiDispatcher.performTrampolineDispatch(AndroidUiDispatcher.android.kt:81)
at androidx.compose.ui.platform.AndroidUiDispatcher.access$performTrampolineDispatch(AndroidUiDispatcher.android.kt:41)
at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.run(AndroidUiDispatcher.android.kt:57)
at android.os.Handler.handleCallback(Handler.java:958)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:230)
at android.os.Looper.loop(Looper.java:319)
at android.app.ActivityThread.main(ActivityThread.java:9063)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:588)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
It's seems the issue now is in val previousEntry = currentBackStack[currentBackStack.size - 2]
:
if (inPredictiveBack) {
LaunchedEffect(progress) {
val previousEntry = currentBackStack[currentBackStack.size - 2]
transitionState.seekTo(progress, previousEntry)
}
}
si...@gmail.com <si...@gmail.com> #19
Filed
Description
Component used: Activity
Versions used:
Devices/Android versions reproduced on: Pixel 7 API 35 (emulator)
Sample project:https://github.com/sindrenm/compose-navigation-crash-repro
This is a follow-up to 340202286 , since #39 requested we open a new issue. I have a sample project (linked above) that reproduces the issue consistently by using the debugger, but we're also seeing this crash happen for our users (same stack trace) in production builds with the same library versions. Note that we have not been able to reproduce it locally without using the debugger, but our users are.
The stack trace is as follows: