Fixed
Status Update
Comments
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #2
Looks like we're incorrectly using 0 as the placeholder value for 'no popUpTo was set' when in fact 0 is a valid value - the value of the root of the graph when no ID is set. We'll switch to a popUpTo of -1 as that default value.
il...@google.com <il...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 58cb7bb9e314406b30414b4198cba9d0d13256cb
Author: Ian Lake <ilake@google.com>
Date: Mon Feb 25 15:33:39 2019
Fix popUpTo with the root graph ID of 0
All navigation nodes must have a valid ID
*except* the root of the navigation graph, which
can have a ID of 0. We should still be able to
popUpTo the root of the graph by using
popUpTo on a navigate() option, so we need to change
the default value from 0 to -1.
Test: new NavControllerTest
Fixes: 126251695
Change-Id: Iac3ac25abdb91562753db25ff09d23bec7f46292
M navigation/common/ktx/src/main/java/androidx/navigation/NavOptionsBuilder.kt
M navigation/common/src/main/java/androidx/navigation/NavOptions.java
M navigation/runtime/src/androidTest/java/androidx/navigation/NavControllerTest.kt
M navigation/runtime/src/main/java/androidx/navigation/NavController.java
M navigation/runtime/src/main/java/androidx/navigation/NavInflater.java
https://android-review.googlesource.com/912257
https://goto.google.com/android-sha1/58cb7bb9e314406b30414b4198cba9d0d13256cb
Branch: androidx-master-dev
commit 58cb7bb9e314406b30414b4198cba9d0d13256cb
Author: Ian Lake <ilake@google.com>
Date: Mon Feb 25 15:33:39 2019
Fix popUpTo with the root graph ID of 0
All navigation nodes must have a valid ID
*except* the root of the navigation graph, which
can have a ID of 0. We should still be able to
popUpTo the root of the graph by using
popUpTo on a navigate() option, so we need to change
the default value from 0 to -1.
Test: new NavControllerTest
Fixes: 126251695
Change-Id: Iac3ac25abdb91562753db25ff09d23bec7f46292
M navigation/common/ktx/src/main/java/androidx/navigation/NavOptionsBuilder.kt
M navigation/common/src/main/java/androidx/navigation/NavOptions.java
M navigation/runtime/src/androidTest/java/androidx/navigation/NavControllerTest.kt
M navigation/runtime/src/main/java/androidx/navigation/NavController.java
M navigation/runtime/src/main/java/androidx/navigation/NavInflater.java
Description
Version used: alpha11
Devices/Android versions reproduced on: Android Studio 3.4 beta 2
I found a strange case, this morning, when I was trying to integrate the new alpha11 build into a project. I've replicated a minimal test case into a project and have replicated the situation.
What I see:
During build:
/Users/nealsanche/robots/Alpha11GlobalBug/app/build/generated/source/navigation-args/debug/com/robotsandpencils/testapp/tab1/Tab1FragmentDirections.java:10: error: cannot find symbol
public static com.robotsandpencils.testapp.Tab1FragmentDirections.com.robotsandpencils.testapp.NavGraphDirections.ActionGlobalGlobalFragment actionGlobalGlobalFragment() {
^
symbol: class com
location: class Tab1FragmentDirections
/Users/nealsanche/robots/Alpha11GlobalBug/app/build/generated/source/navigation-args/debug/com/robotsandpencils/testapp/tab2/Tab2FragmentDirections.java:26: error: cannot find symbol
public static com.robotsandpencils.testapp.Tab2FragmentDirections.com.robotsandpencils.testapp.NavGraphDirections.ActionGlobalGlobalFragment actionGlobalGlobalFragment() {
^
symbol: class com
location: class Tab2FragmentDirections
/Users/nealsanche/robots/Alpha11GlobalBug/app/build/generated/source/navigation-args/debug/com/robotsandpencils/testapp/tab3/Tab3FragmentDirections.java:26: error: cannot find symbol
public static com.robotsandpencils.testapp.Tab3FragmentDirections.com.robotsandpencils.testapp.NavGraphDirections.ActionGlobalGlobalFragment actionGlobalGlobalFragment() {
^
symbol: class com
location: class Tab3FragmentDirections
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
3 errors
FAILURE: Build failed with an exception.
All I did was right click on the GlobalFragment and generated a 'global' action from the menu.