Fixed
Status Update
Comments
le...@gmail.com <le...@gmail.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit f57b5cbd142016a2d95fd7bf736262049b085aeb
Author: Jeremy Woods <jbwoods@google.com>
Date: Mon Nov 09 13:23:07 2020
Move FloatingWindow interface to Kotlin
Converted the FloatingWindow inferface to koltin and added the kotlin
std library dependency to navigation-common.
Test: ./gradlew checkApi
Bug: 172823546
Change-Id: I98af40e5c9bc747d792180990f1654d6353aa4b5
M navigation/navigation-common/build.gradle
M navigation/navigation-common/src/main/java/androidx/navigation/FloatingWindow.kt
https://android-review.googlesource.com/1492738
Branch: androidx-master-dev
commit f57b5cbd142016a2d95fd7bf736262049b085aeb
Author: Jeremy Woods <jbwoods@google.com>
Date: Mon Nov 09 13:23:07 2020
Move FloatingWindow interface to Kotlin
Converted the FloatingWindow inferface to koltin and added the kotlin
std library dependency to navigation-common.
Test: ./gradlew checkApi
Bug: 172823546
Change-Id: I98af40e5c9bc747d792180990f1654d6353aa4b5
M navigation/navigation-common/build.gradle
M navigation/navigation-common/src/main/java/androidx/navigation/FloatingWindow.kt
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit b637fdfd6b937d19d4e419c4bfba9b437af6378c
Author: Ian Lake <ilake@google.com>
Date: Thu Apr 01 16:13:27 2021
Merge Navigation Compose version back into Navigation
Rather than run Navigation Compose as a separate,
parallel project from the other Navigation artifacts,
merge the versions together so that we can better
integrate the artifacts together and leverage new
alpha features.
Test: ./gradlew bOS, ran Studio in FLAN and COMPOSE configs
BUG: 172823546
Change-Id: I139a44d95c91dc3cf2e951225aabbc2581914e95
M buildSrc/src/main/kotlin/androidx/build/LibraryVersions.kt
M navigation/navigation-compose/build.gradle
M navigation/navigation-compose/samples/build.gradle
M navigation/navigation-compose/src/androidTest/java/androidx/navigation/compose/NavHostTest.kt
M navigation/navigation-runtime/build.gradle
M settings.gradle
M testutils/testutils-navigation/build.gradle
https://android-review.googlesource.com/1662999
Branch: androidx-main
commit b637fdfd6b937d19d4e419c4bfba9b437af6378c
Author: Ian Lake <ilake@google.com>
Date: Thu Apr 01 16:13:27 2021
Merge Navigation Compose version back into Navigation
Rather than run Navigation Compose as a separate,
parallel project from the other Navigation artifacts,
merge the versions together so that we can better
integrate the artifacts together and leverage new
alpha features.
Test: ./gradlew bOS, ran Studio in FLAN and COMPOSE configs
BUG: 172823546
Change-Id: I139a44d95c91dc3cf2e951225aabbc2581914e95
M buildSrc/src/main/kotlin/androidx/build/LibraryVersions.kt
M navigation/navigation-compose/build.gradle
M navigation/navigation-compose/samples/build.gradle
M navigation/navigation-compose/src/androidTest/java/androidx/navigation/compose/NavHostTest.kt
M navigation/navigation-runtime/build.gradle
M settings.gradle
M testutils/testutils-navigation/build.gradle
jb...@google.com <jb...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-main
commit 51769b7a8d6d3e2032e45b3ec1e3cfe29e718ab6
Author: Jeremy Woods <jbwoods@google.com>
Date: Wed Mar 31 10:59:25 2021
Add routes to NavDestination
This change introduces the concept of a route to NavDestination. A route
is String that defines the path to the Destination. Setting the route on
a NavDestination will replace the any id that was set previously and
adds a deep link to the destination. You can set a route on the
NavDestination programatically, or through xml.
RelNote: "You can now add a route to your NavDestination"
Test: NavDestinationTest
Bug: 172823546
Change-Id: I77daf563f480ae54b9728a78e7696ea96d19f264
M navigation/navigation-common/api/current.txt
M navigation/navigation-common/api/public_plus_experimental_current.txt
M navigation/navigation-common/api/restricted_current.txt
M navigation/navigation-common/src/androidTest/java/androidx/navigation/NavDestinationAndroidTest.kt
M navigation/navigation-common/src/main/java/androidx/navigation/NavDestination.kt
M navigation/navigation-common/src/main/res-public/values/public_attrs.xml
M navigation/navigation-common/src/main/res/values/attrs.xml
https://android-review.googlesource.com/1660682
Branch: androidx-main
commit 51769b7a8d6d3e2032e45b3ec1e3cfe29e718ab6
Author: Jeremy Woods <jbwoods@google.com>
Date: Wed Mar 31 10:59:25 2021
Add routes to NavDestination
This change introduces the concept of a route to NavDestination. A route
is String that defines the path to the Destination. Setting the route on
a NavDestination will replace the any id that was set previously and
adds a deep link to the destination. You can set a route on the
NavDestination programatically, or through xml.
RelNote: "You can now add a route to your NavDestination"
Test: NavDestinationTest
Bug: 172823546
Change-Id: I77daf563f480ae54b9728a78e7696ea96d19f264
M navigation/navigation-common/api/current.txt
M navigation/navigation-common/api/public_plus_experimental_current.txt
M navigation/navigation-common/api/restricted_current.txt
M navigation/navigation-common/src/androidTest/java/androidx/navigation/NavDestinationAndroidTest.kt
M navigation/navigation-common/src/main/java/androidx/navigation/NavDestination.kt
M navigation/navigation-common/src/main/res-public/values/public_attrs.xml
M navigation/navigation-common/src/main/res/values/attrs.xml
Description
The
MainActivity
gets leaked after the second time the orientation changes, but only after navigating to a new destination using thenavHostController
.A working project where this can be reproduced is available here .
These are the reproduction steps:
FooScreen
, that only contains aTopAppBar
and aButton
).Button
(it will load theBarScreen
, that only contains aTopAppBar
)At this point you should see
StrictMode
complaining about the leak inside the logcat:The LeakCanary notification should also be visible . This is the LeakCanary log:
Things I have noticed:
adb shell am start -d "template://bar" -a android.intent.action.VIEW
)I've also tried to use the Android Studio Profiled to investigate the leak, but I wasn't really successful. Here some screenshots:
This is the overview of the modules of the repro project: enter image description here
In short, the App only has the single Activity with no logic beside setting up the nav host. The navigation logic is inside the
core-navigation
. Each feature module provides UI and business logic. Currently there are 3 features with 1 screen each: Foo, Bar and Debug. Foo screen has only one button that leads to Bar screen. The leak happens inside Bar screen, if you rotate the device twice. It does not happen if you access Bar via Deeplink.