Status Update
Comments
jb...@google.com <jb...@google.com>
cl...@google.com <cl...@google.com> #2
This is because of the bug fix for
Navigation had a long-standing bug where deeplinks would match if only one of three uriPattern / action / mimeType matches. But now they all three have to match exactly.
In your case, your requested deeplink has an action (adb shell am start android.intent.action.VIEW ...
), but the deeplink added to the destination does not (navDeepLink { uriPattern = "$uri/{id}/{wd}" }
)
To fix this, you could either
- remove action from the intent
- in the destination deeplink, add the matching action
cl...@google.com <cl...@google.com> #3
Reopened - the requested deeplink should still match if it has an action while the added deeplink does not.
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-main
Author: Clara Fok <
Link:
Fix deeplink matching logic
Expand for full commit details
Fix deeplink matching logic
Right now deeplink does not match if the request has non-null fields that are null in the deeplink. However this should still match.
A Deeplink should be a potential match as long as any added non-null fields (uri / action/ mimeType) are also non-null and matches in the request.
Reverted a few test updates from aosp/3490354 and reorganized deeplink-related tests to improve readability and prevent false positives.
Test: ./gradlew navigation:navigation-common:cC
Test: ./gradlew navigation:navigation-runtime:cC
Bug: 399826566
Fixes: 399136426
Relnote: "Fixed deeplink not matching when the request has non-null fields that are null in the expected deeplink."
Change-Id: Ie5e36911112218baf8c53ee142f1366caa31a8b2
Files:
- M
navigation/navigation-common/src/commonMain/kotlin/androidx/navigation/NavDeepLink.kt
- M
navigation/navigation-fragment/src/androidTest/java/androidx/navigation/fragment/BaseNavControllerTest.kt
- M
navigation/navigation-runtime/src/androidInstrumentedTest/kotlin/androidx/navigation/NavControllerRouteTest.kt
- M
navigation/navigation-runtime/src/androidInstrumentedTest/kotlin/androidx/navigation/NavControllerTest.kt
- M
navigation/navigation-runtime/src/androidInstrumentedTest/kotlin/androidx/navigation/NavInflaterTest.kt
- M
navigation/navigation-runtime/src/androidInstrumentedTest/res/navigation/nav_deeplink.xml
- A
navigation/navigation-runtime/src/androidInstrumentedTest/res/navigation/nav_mime.xml
- M
navigation/navigation-runtime/src/androidInstrumentedTest/res/navigation/nav_simple.xml
Hash: 54646fdff27eb9c4785a90a589c9ad29bb9fbfb2
Date: Fri Feb 28 14:59:00 2025
jb...@google.com <jb...@google.com> #5
This has been fixed internally and will be part of the Navigation 2.8.9
release.
jb...@google.com <jb...@google.com>
na...@google.com <na...@google.com> #6
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.navigation:navigation-common:2.9.0-alpha08
androidx.navigation:navigation-common-android:2.9.0-alpha08
androidx.navigation:navigation-common-desktop:2.9.0-alpha08
androidx.navigation:navigation-common-iosarm64:2.9.0-alpha08
androidx.navigation:navigation-common-iossimulatorarm64:2.9.0-alpha08
androidx.navigation:navigation-common-iosx64:2.9.0-alpha08
androidx.navigation:navigation-common-linuxarm64:2.9.0-alpha08
androidx.navigation:navigation-common-linuxx64:2.9.0-alpha08
androidx.navigation:navigation-common-macosarm64:2.9.0-alpha08
androidx.navigation:navigation-common-macosx64:2.9.0-alpha08
androidx.navigation:navigation-fragment:2.9.0-alpha08
androidx.navigation:navigation-runtime:2.9.0-alpha08
androidx.navigation:navigation-runtime-android:2.9.0-alpha08
androidx.navigation:navigation-runtime-desktop:2.9.0-alpha08
androidx.navigation:navigation-runtime-iosarm64:2.9.0-alpha08
androidx.navigation:navigation-runtime-iossimulatorarm64:2.9.0-alpha08
androidx.navigation:navigation-runtime-iosx64:2.9.0-alpha08
androidx.navigation:navigation-runtime-linuxarm64:2.9.0-alpha08
androidx.navigation:navigation-runtime-linuxx64:2.9.0-alpha08
androidx.navigation:navigation-runtime-macosarm64:2.9.0-alpha08
androidx.navigation:navigation-runtime-macosx64:2.9.0-alpha08
androidx.navigation:navigation-common:2.8.9
androidx.navigation:navigation-fragment:2.8.9
androidx.navigation:navigation-runtime:2.8.9
jb...@gmail.com <jb...@gmail.com> #7
still need to stay on 2.8.7
Description
Version used: 2.8.8
Devices/Android versions reproduced on:
Pixel 8 Pro
Issue description:
I have an app with Compose and 2 simple destinations: start destination "home" and deeplink destination "url"
I was able to access the "url" screen by launching:
adb shell am start -W -a android.intent.action.VIEW -d "xiver://
Last 2 fields: "dsfds" and "32" are parameters.
After library update from 2.7.7 to 2.8.8 it stopped working and now only "home" destination is opened.
If this is a bug in the library, we would appreciate if you could attach:
- Sample project to trigger the issue. [ATTACHED]