Fixed
Status Update
Comments
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #2
What about Enums? Enum is a type-safe way to pass navigation arguments.
Will Enums be covered in this issue as part of Serializable or will have own handled separately?
Because for enum you can provide a reasonable default value but for Parcelable or Serializable only @null
Will Enums be covered in this issue as part of Serializable or will have own handled separately?
Because for enum you can provide a reasonable default value but for Parcelable or Serializable only @null
il...@google.com <il...@google.com> #3
Please add support for Serializable objects so Enums can be used.
ap...@google.com <ap...@google.com> #4
Support of Serializable objects is not enough for enums, you definitely need also the support of default values.
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 6f59e3d74d0da5a4bf79c8480f56964e3af47f1c
Author: Wojtek Kaliciński <wkal@google.com>
Date: Mon Jul 23 20:17:19 2018
Support more types for args
Provides support for Serializable, enums,
as well as arrays of primitive types and Parcelables
in Navigation arguments.
Only enums support default values other than @null,
in the form of the enum literal (without class name),
e.g. app:defaultValue="READ"
Test: unit tests updated
BUG: 111487504
BUG: 111316353
Change-Id: I7e5abbc8ed0950bfdef292342dbe1fb34a5c4b17
M navigation/runtime/src/androidTest/java/androidx/navigation/NavInflaterTest.kt
A navigation/runtime/src/androidTest/java/androidx/navigation/test/TestEnum.java
M navigation/runtime/src/androidTest/res/navigation/nav_default_arguments.xml
M navigation/runtime/src/main/java/androidx/navigation/NavInflater.java
M navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/NavParser.kt
M navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/NavParserErrors.kt
M navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/NavWriter.kt
M navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/Types.kt
M navigation/safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/NavParserTest.kt
M navigation/safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/NavWriterTest.kt
M navigation/safe-args-generator/src/tests/test-data/expected/nav_writer_test/MainFragmentArgs.java
M navigation/safe-args-generator/src/tests/test-data/expected/nav_writer_test/Next.java
M navigation/safe-args-generator/src/tests/test-data/naive_test.xml
https://android-review.googlesource.com/720246
https://goto.google.com/android-sha1/6f59e3d74d0da5a4bf79c8480f56964e3af47f1c
Branch: androidx-master-dev
commit 6f59e3d74d0da5a4bf79c8480f56964e3af47f1c
Author: Wojtek Kaliciński <wkal@google.com>
Date: Mon Jul 23 20:17:19 2018
Support more types for args
Provides support for Serializable, enums,
as well as arrays of primitive types and Parcelables
in Navigation arguments.
Only enums support default values other than @null,
in the form of the enum literal (without class name),
e.g. app:defaultValue="READ"
Test: unit tests updated
BUG: 111487504
BUG: 111316353
Change-Id: I7e5abbc8ed0950bfdef292342dbe1fb34a5c4b17
M navigation/runtime/src/androidTest/java/androidx/navigation/NavInflaterTest.kt
A navigation/runtime/src/androidTest/java/androidx/navigation/test/TestEnum.java
M navigation/runtime/src/androidTest/res/navigation/nav_default_arguments.xml
M navigation/runtime/src/main/java/androidx/navigation/NavInflater.java
M navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/NavParser.kt
M navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/NavParserErrors.kt
M navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/NavWriter.kt
M navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/Types.kt
M navigation/safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/NavParserTest.kt
M navigation/safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/NavWriterTest.kt
M navigation/safe-args-generator/src/tests/test-data/expected/nav_writer_test/MainFragmentArgs.java
M navigation/safe-args-generator/src/tests/test-data/expected/nav_writer_test/Next.java
M navigation/safe-args-generator/src/tests/test-data/naive_test.xml
ap...@google.com <ap...@google.com> #6
This is fixed internally and will be available in 1.0.0-alpha08
ap...@google.com <ap...@google.com> #7
What happened if I declaire app:argType="androidx.navigation.test.TestEnum" and turn on proguard/R8? Because both ProGuard and R8 will optimize trivial enums into ints.
ap...@google.com <ap...@google.com> #8
ap...@google.com <ap...@google.com> #9
Thanks. Just saw the latest documentation.
ap...@google.com <ap...@google.com> #10
Project: platform/frameworks/support
Branch: snap-temp-L69500000699869549
commit 7204d04ad74baf9816389e27778266391fbd79a5
Author: Ian Lake <ilake@google.com>
Date: Mon Sep 14 16:10:06 2020
Mention the current destination in getBackStackEntry errors
Improve the debugging experience for "No destination
with ID..." errors in getBackStackEntry() by mentioning
exactly destination the NavController is on. This would
allow developers to know if they have called popBackStack()
to a destination they don't expect to be at or if
they have not called setGraph() at all (where the
current destination would be null).
Test: existing tests pass
BUG: 168311416
Change-Id: Ia96b6732d7caadbddf31b7f35a1a419407ff6e25
(cherry picked from commit d0a10be065a3a629e3835f28d35804c91d8d2e4d)
M navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.java
https://android-review.googlesource.com/1436913
Branch: snap-temp-L69500000699869549
commit 7204d04ad74baf9816389e27778266391fbd79a5
Author: Ian Lake <ilake@google.com>
Date: Mon Sep 14 16:10:06 2020
Mention the current destination in getBackStackEntry errors
Improve the debugging experience for "No destination
with ID..." errors in getBackStackEntry() by mentioning
exactly destination the NavController is on. This would
allow developers to know if they have called popBackStack()
to a destination they don't expect to be at or if
they have not called setGraph() at all (where the
current destination would be null).
Test: existing tests pass
BUG: 168311416
Change-Id: Ia96b6732d7caadbddf31b7f35a1a419407ff6e25
(cherry picked from commit d0a10be065a3a629e3835f28d35804c91d8d2e4d)
M navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.java
ap...@google.com <ap...@google.com> #11
Project: platform/frameworks/support
Branch: snap-temp-L31300000699869852
commit 398a1fe7bb7792589189574aec5f6e77bb749229
Author: Ian Lake <ilake@google.com>
Date: Mon Sep 14 16:10:06 2020
Mention the current destination in getBackStackEntry errors
Improve the debugging experience for "No destination
with ID..." errors in getBackStackEntry() by mentioning
exactly destination the NavController is on. This would
allow developers to know if they have called popBackStack()
to a destination they don't expect to be at or if
they have not called setGraph() at all (where the
current destination would be null).
Test: existing tests pass
BUG: 168311416
Change-Id: Ia96b6732d7caadbddf31b7f35a1a419407ff6e25
(cherry picked from commit d0a10be065a3a629e3835f28d35804c91d8d2e4d)
M navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.java
https://android-review.googlesource.com/1436917
Branch: snap-temp-L31300000699869852
commit 398a1fe7bb7792589189574aec5f6e77bb749229
Author: Ian Lake <ilake@google.com>
Date: Mon Sep 14 16:10:06 2020
Mention the current destination in getBackStackEntry errors
Improve the debugging experience for "No destination
with ID..." errors in getBackStackEntry() by mentioning
exactly destination the NavController is on. This would
allow developers to know if they have called popBackStack()
to a destination they don't expect to be at or if
they have not called setGraph() at all (where the
current destination would be null).
Test: existing tests pass
BUG: 168311416
Change-Id: Ia96b6732d7caadbddf31b7f35a1a419407ff6e25
(cherry picked from commit d0a10be065a3a629e3835f28d35804c91d8d2e4d)
M navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.java
ap...@google.com <ap...@google.com> #12
Project: platform/frameworks/support
Branch: snap-temp-L53700000699921463
commit 31027c16ff20b10e78093f8de205c81fc49dfc92
Author: Ian Lake <ilake@google.com>
Date: Mon Sep 14 16:10:06 2020
Mention the current destination in getBackStackEntry errors
Improve the debugging experience for "No destination
with ID..." errors in getBackStackEntry() by mentioning
exactly destination the NavController is on. This would
allow developers to know if they have called popBackStack()
to a destination they don't expect to be at or if
they have not called setGraph() at all (where the
current destination would be null).
Test: existing tests pass
BUG: 168311416
Change-Id: Ia96b6732d7caadbddf31b7f35a1a419407ff6e25
(cherry picked from commit d0a10be065a3a629e3835f28d35804c91d8d2e4d)
M navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.java
https://android-review.googlesource.com/1436920
Branch: snap-temp-L53700000699921463
commit 31027c16ff20b10e78093f8de205c81fc49dfc92
Author: Ian Lake <ilake@google.com>
Date: Mon Sep 14 16:10:06 2020
Mention the current destination in getBackStackEntry errors
Improve the debugging experience for "No destination
with ID..." errors in getBackStackEntry() by mentioning
exactly destination the NavController is on. This would
allow developers to know if they have called popBackStack()
to a destination they don't expect to be at or if
they have not called setGraph() at all (where the
current destination would be null).
Test: existing tests pass
BUG: 168311416
Change-Id: Ia96b6732d7caadbddf31b7f35a1a419407ff6e25
(cherry picked from commit d0a10be065a3a629e3835f28d35804c91d8d2e4d)
M navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.java
ap...@google.com <ap...@google.com> #13
Project: platform/frameworks/support
Branch: snap-temp-L25200000699921867
commit 63e58ff4f522eb70dec6c0749679fb6b963698d8
Author: Ian Lake <ilake@google.com>
Date: Mon Sep 14 16:10:06 2020
Mention the current destination in getBackStackEntry errors
Improve the debugging experience for "No destination
with ID..." errors in getBackStackEntry() by mentioning
exactly destination the NavController is on. This would
allow developers to know if they have called popBackStack()
to a destination they don't expect to be at or if
they have not called setGraph() at all (where the
current destination would be null).
Test: existing tests pass
BUG: 168311416
Change-Id: Ia96b6732d7caadbddf31b7f35a1a419407ff6e25
(cherry picked from commit d0a10be065a3a629e3835f28d35804c91d8d2e4d)
M navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.java
https://android-review.googlesource.com/1436924
Branch: snap-temp-L25200000699921867
commit 63e58ff4f522eb70dec6c0749679fb6b963698d8
Author: Ian Lake <ilake@google.com>
Date: Mon Sep 14 16:10:06 2020
Mention the current destination in getBackStackEntry errors
Improve the debugging experience for "No destination
with ID..." errors in getBackStackEntry() by mentioning
exactly destination the NavController is on. This would
allow developers to know if they have called popBackStack()
to a destination they don't expect to be at or if
they have not called setGraph() at all (where the
current destination would be null).
Test: existing tests pass
BUG: 168311416
Change-Id: Ia96b6732d7caadbddf31b7f35a1a419407ff6e25
(cherry picked from commit d0a10be065a3a629e3835f28d35804c91d8d2e4d)
M navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.java
ap...@google.com <ap...@google.com> #14
Project: platform/frameworks/support
Branch: snap-temp-L07700000699933785
commit 56fe0d47de20fb430c4280332a20eb96076dd44b
Author: Ian Lake <ilake@google.com>
Date: Mon Sep 14 16:10:06 2020
Mention the current destination in getBackStackEntry errors
Improve the debugging experience for "No destination
with ID..." errors in getBackStackEntry() by mentioning
exactly destination the NavController is on. This would
allow developers to know if they have called popBackStack()
to a destination they don't expect to be at or if
they have not called setGraph() at all (where the
current destination would be null).
Test: existing tests pass
BUG: 168311416
Change-Id: Ia96b6732d7caadbddf31b7f35a1a419407ff6e25
(cherry picked from commit d0a10be065a3a629e3835f28d35804c91d8d2e4d)
M navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.java
https://android-review.googlesource.com/1436929
Branch: snap-temp-L07700000699933785
commit 56fe0d47de20fb430c4280332a20eb96076dd44b
Author: Ian Lake <ilake@google.com>
Date: Mon Sep 14 16:10:06 2020
Mention the current destination in getBackStackEntry errors
Improve the debugging experience for "No destination
with ID..." errors in getBackStackEntry() by mentioning
exactly destination the NavController is on. This would
allow developers to know if they have called popBackStack()
to a destination they don't expect to be at or if
they have not called setGraph() at all (where the
current destination would be null).
Test: existing tests pass
BUG: 168311416
Change-Id: Ia96b6732d7caadbddf31b7f35a1a419407ff6e25
(cherry picked from commit d0a10be065a3a629e3835f28d35804c91d8d2e4d)
M navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.java
vi...@gws.hotstar.com <vi...@gws.hotstar.com> #15
getting this error even after ensuring we are setting graph before using it..
Caused by java.lang.IllegalArgumentException
No destination with ID 2131427956 is on the NavController's back stack in HiltNavGraphViewModelLazy.kt:49) , we are using androidx.hilt:hilt-navigation-fragment:1.0.0
androidx.navigation.NavController.getBackStackEntry (NavController.kt:2204)
androidx.hilt.navigation.fragment.HiltNavGraphViewModelLazyKt$hiltNavGraphViewModels$backStackEntry$2.invoke (HiltNavGraphViewModelLazyKt.java:49)
$special$$inlined$hiltNavGraphViewModels$4.invoke (HiltNavGraphViewModelLazy.kt:49)
is there any way to prevent it?
Caused by java.lang.IllegalArgumentException
No destination with ID 2131427956 is on the NavController's back stack in HiltNavGraphViewModelLazy.kt:49) , we are using androidx.hilt:hilt-navigation-fragment:1.0.0
androidx.navigation.NavController.getBackStackEntry (NavController.kt:2204)
androidx.hilt.navigation.fragment.HiltNavGraphViewModelLazyKt$hiltNavGraphViewModels$backStackEntry$2.invoke (HiltNavGraphViewModelLazyKt.java:49)
$special$$inlined$hiltNavGraphViewModels$4.invoke (HiltNavGraphViewModelLazy.kt:49)
is there any way to prevent it?
al...@gmail.com <al...@gmail.com> #16
Could we further improve this by indicating the name of the destination instead of just the ID number?
jb...@google.com <jb...@google.com> #17
If you use a resource to provide the name it will already be displayed. Along with any route or label you may have added.
sh...@gmail.com <sh...@gmail.com> #18
We are also getting this error even after ensuring we are setting the graph before using .popBackStack().
Is there any way to safeguard against this? I am not able to reproduce the error myself, but get a lot of errors show up in Crashlytics
Is there any way to safeguard against this? I am not able to reproduce the error myself, but get a lot of errors show up in Crashlytics
wm...@gmail.com <wm...@gmail.com> #19
I have the same problem
ze...@gmail.com <ze...@gmail.com> #20
Same here. It is not fixed. Can you reopen and look again?
ir...@gmail.com <ir...@gmail.com> #21
Same problem here
ji...@gmail.com <ji...@gmail.com> #22
Same problem here
ru...@gmail.com <ru...@gmail.com> #23
Same problem here
fa...@fob-solutions.com <fa...@fob-solutions.com> #24
Same problem here, currently using version 2.7.7
ev...@gmail.com <ev...@gmail.com> #25
same problem here
Description
Version used: 2.3.0
While using `by navGraphViewModels`, my crash reporting reports an error when invoked
NavGraphViewModelLazy.kt line 56
Fatal Exception: java.lang.IllegalArgumentException: No destination with ID 2131296839 is on the NavController's back stack
at androidx.navigation.NavController.getBackStackEntry(NavController.java:1293)
at com.example.ExampleFragment$$special$$inlined$navGraphViewModels$1.invoke(NavGraphViewModelLazy.kt:56)
[...]
This is difficult to debug since the navGraphId that I pass in should theoretically always be in the NavController's back stack when navGraphViewModels is invoked. The error message could be improved by letting me know what IS available on the back stack or if the back stack is completely empty.