Status Update
Comments
uc...@google.com <uc...@google.com> #2
this issue was created using original issue https://issuetracker.google.com/issues/389970341#comment2
.
but i am not sure that described text above is the same as in original issue:
also doesn't work
https://example.com/path/detail?token=123 in all versions.
pattern:
https://example.com/path/.*?token={id}
P.S. original issue also has test project https://issuetracker.google.com/389970341#attachment62385890
il...@gmail.com <il...@gmail.com> #3
It's essentially the same cause - navigation is prioritizing the wrong deeplink when they share the same action.
il...@gmail.com <il...@gmail.com> #4
Fixed internally and will be available in navigation-2.8.8
vs...@google.com <vs...@google.com>
en...@google.com <en...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-main
Author: Clara Fok <
Link:
Fix deeplink incorrectly matching when deep link fields don’t match perfectly
Expand for full commit details
Fix deeplink incorrectly matching when deep link fields don’t match perfectly
Navigation used to allow matching as long as one of three (uri / action / mimType) matches. However this is erroneous, as each field is a defined filter - a potential match should at the very least fulfill all filters.
This is fixed by applying these ground rules for deeplink matching:
1. The added NavDeepLink field’s nullability has to match the NavDeepLinkRequest field’s nullability. i.e. if deeplink.uri is null, request.uri must also be null
2. Any NavDeepLink non-null fields has to match exactly with NavDeepLinkRequest’s non-null fields
To elaborate, consider this scenario where
request:
“www.example.com/13”, action = “theAction”
potential matches:
1. www.example.com/{id}, action = "theAction"
2. www.differentUrl.com, action = "theAction"
When handling this request , even though deeplink 2 has a matching action, the differing url will rule it out as a potential match.
This fix also addresses a bug with wildcards where
request:
www.example.com/wildCardMatch?token=123, action = "theAction"
potential matches:
1. www.example.com/.*?token={id}, action = "theAction"
2. www.example.com?token={id}, action = "theAction"
Even though both deep links have a matching Action, deeplink 1 has a better Uri match, and so the request will now match with deeplink 1 instead of deeplink 2.
Test: ./gradlew navigation:navigation-common:cC
Test: ./gradlew navigation:navigation-runtime:cC
Bug: 395712033
Relnote: “NavDeepLink matching has been fixed where a deeplink and a deeplink request have to match exactly on uri, action, and mime. Matching is no longer allowed if only one or two fields match.“
Change-Id: I3b0295caa6324cc707d080856e88e62b4c3cd4d5
Files:
- M
navigation/navigation-common/src/androidInstrumentedTest/kotlin/androidx/navigation/NavGraphAndroidTest.kt
- M
navigation/navigation-common/src/androidMain/kotlin/androidx/navigation/NavDestination.android.kt
- 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
- M
navigation/navigation-runtime/src/androidInstrumentedTest/res/navigation/nav_simple.xml
Hash: 85ccd3f102d5d1da4bfc7ceba71425319a6f1c50
Date: Wed Feb 19 12:51:38 2025
zy...@google.com <zy...@google.com> #6
I think this fix has broken some other deeplinks.
I have the following defined in my NavHost file:
composable<Screen.AttractionDetail>(deepLinks = listOf(navDeepLink<Screen.AttractionDetail>(basePath = "gocity:/attraction"))) ...
@Serializable
data class AttractionDetail(val id: String, val hideBookmark: Boolean = false) : Screen
In one of my UI tests I have this code:
deeplinkNavigator("gocity:/attraction/$attractionId")
With 2.8.7 this works fine but as soon as I upgrade to 2.8.8 the deeplink no longer opens the AttractionDetail screen.
I've experimented with changing the data class to be val hideBookmark: Boolean?
and to using uriPattern
instead of basePath
but I can't get this deeplink to work in 2.8.8
en...@google.com <en...@google.com> #7
@Serializable
sealed interface Screen {
@Serializable
data class AttractionDetail(val id: String, val hideBookmark: Boolean = false) : Screen
}
controller.graph =
controller.createGraph(startDestination = "start") {
...
composable<Screen.AttractionDetail> { deepLink(navDeepLink<Screen.AttractionDetail>("gocity:/attraction")) }
}
val request = NavDeepLinkRequest(Uri.parse("gocity:/attraction/13"), null, null)
val handled = controller.handleDeepLink(request)
Can you file a separate bug and attach a repro?
en...@google.com <en...@google.com> #8
I also had problem after updating to version 2.8.8.
Explicitly setting action
to Intent.ACTION_VIEW
in the Deep Link builder now may be required if your intent filter for deeplink schema has android.intent.action.VIEW
.
At least that's how I solved the issue that I got after using version 2.8.8.
See example:
Manifest:
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:scheme="company"
android:host="app"
android:pathPattern="/.*" />
</intent-filter>
In broadcast receiver:
//...
val deepLinkUri = NavDeepLinks.progressDeepLink.uriPattern
val intent = Intent(
Intent.ACTION_VIEW,
Uri.parse(deepLinkUri) //
).apply {
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP
`package` = context.packageName
}
val pendingIntent = PendingIntent.getActivity(
context,
0,
intent,
PendingIntent.FLAG_IMMUTABLE
)
//...
Definition of DeepLink using builder:
val progressDeepLink = navDeepLink {
uriPattern = "$BASE/${Path.PROGRESS}"
action = Intent.ACTION_VIEW
}
Compose Navigation Graph Builder:
navigation<LimitsDirection>(
deepLinks = listOf(NavDeepLinks.limitsDeepLink)
) {
LimitsScreen(viewModel = limitsViewModel)
}
I hope that helps you.
Also, may be this fix requires some update for documentation and/or guides
ts...@gmail.com <ts...@gmail.com> #11
yo...@gmail.com <yo...@gmail.com> #12
ch...@gmail.com <ch...@gmail.com> #13
bo...@gmail.com <bo...@gmail.com> #14
If someone has found a way to suppress this error let us know !
me...@morl.au <me...@morl.au> #15
me...@morl.au <me...@morl.au> #17
ba...@gmail.com <ba...@gmail.com> #18
ch...@gmx.de <ch...@gmx.de> #19
ar...@gmail.com <ar...@gmail.com> #20
ar...@gmail.com <ar...@gmail.com> #21
full log:
C:\Android\SDK\platform-tools>adb sideload ../rom.zip
loading: '../rom.zip'...
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
fe...@gmail.com <fe...@gmail.com> #22
ni...@gmail.com <ni...@gmail.com> #23
t....@gmail.com <t....@gmail.com> #24
ch...@gmail.com <ch...@gmail.com> #25
sa...@gmail.com <sa...@gmail.com> #26
Download the LLA, go to Mode -> Advanced. Then, go to Add -> Files in folder recursive ... Select the folder where you have platform-tools installed (or unzipped). Select all the files in LLA then go to With selected -> Force Large Address Aware.
Tested on Win10, ran adb sideload <image> from cmd.exe with Administrative privilege. Installed 7.1.1 OTA on Nexus 6 without any issues.
ma...@gmail.com <ma...@gmail.com> #27
ad...@gmail.com <ad...@gmail.com> #28
ak...@gmail.com <ak...@gmail.com> #30
ak...@gmail.com <ak...@gmail.com> #31
On old versions .3 and .1 I get cannot read "file".
Am I doing something wrong? It was a long time since I tried to sideload something.
ma...@gmail.com <ma...@gmail.com> #33
a6...@gmail.com <a6...@gmail.com> #34
win10 x64
platform-tools r25.0.3 (link at #16)
oneplus 3t Oxygen OS
a6...@gmail.com <a6...@gmail.com> #35
win10 x64
platform-tools r25.0.3 (link at #16)
oneplus 3t Oxygen OS
en...@google.com <en...@google.com> #36
en...@google.com <en...@google.com> #37
bl...@gmail.com <bl...@gmail.com> #38
en...@google.com <en...@google.com> #39
sc...@gmail.com <sc...@gmail.com> #40
en...@google.com <en...@google.com> #41
bl...@gmail.com <bl...@gmail.com> #42
Android Debug Bridge version 1.0.39
Revision 3db08f2c6889-android
downloaded last night from:
en...@google.com <en...@google.com> #43
bl...@gmail.com <bl...@gmail.com> #44
en...@google.com <en...@google.com> #45
but it doesn't really make sense: you really shouldn't be on that codepath talking to a 6P. i think JellyBean was the last release that used the older sideload method! it looks like we'll give the old method a go regardless of how the new method fails. so my suspicion is that your real problem is that adb isn't able to talk to your 6P and falls back to the old method just in case (even though we know that won't work because the 6P is too new, adb doesn't).
the output from
adb kill-server
set ADB_TRACE=all
adb sideload <whatever you've been doing>
might be informative.
bl...@gmail.com <bl...@gmail.com> #46
en...@google.com <en...@google.com> #47
(have you ever sideloaded before? you know that you have to get the device ready to receive before "adb sideload" will work?)
am...@gmail.com <am...@gmail.com> #48
bl...@gmail.com <bl...@gmail.com> #49
List of devices attached
8XV7N15B24004979 device
Is that my device?
I have never sideloaded. I haven't messed with a rom since Samsung S3 days.
I would think that it sees my device since I can do the "adb reboot recovery"
en...@google.com <en...@google.com> #50
@miguel: that's actually a 6P bug where it drops off USB when it reboots. i'm assuming that's fixed in O, but you're right that it might be worth adding an "adb devices" step to the instructions. i'll see what i can do.
i've uploaded
$ adb sideload mysid-ota-424425.zip
adb: sideload connection failed: no devices/emulators found
adb: trying pre-KitKat sideload method...
adb: pre-KitKat sideload connection failed: no devices/emulators found
bl...@gmail.com <bl...@gmail.com> #51
i unplugged and replugged in my phone and got a installing drivers screen. looks like it is working now???!!
I'm at the serving :~2% so far.
lo...@gmail.com <lo...@gmail.com> #52
bl...@gmail.com <bl...@gmail.com> #53
cb...@gmail.com <cb...@gmail.com> #54
cb...@gmail.com <cb...@gmail.com> #55
en...@google.com <en...@google.com> #56
ja...@gmail.com <ja...@gmail.com> #57
opening '.\marlin-ota-n2g47o-61bf55a3.zip'...
connecting...
falling back to older sideload method...
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
I tried unplugging and plugging back in once recovery was up, no change.
ja...@gmail.com <ja...@gmail.com> #58
en...@google.com <en...@google.com> #59
i've also updated the public instructions at
li...@gmail.com <li...@gmail.com> #60
PS C:\Users\wohen> adb reboot sideload "D:\download\Compressed\update.zip"
PS C:\Users\wohen> adb sideload "D:\download\Compressed\update.zip"
loading: 'D:\download\Compressed\update.zip'...
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
...........................................................
en...@google.com <en...@google.com> #61
am...@gmail.com <am...@gmail.com> #62
am...@gmail.com <am...@gmail.com> #63
da...@gmail.com <da...@gmail.com> #64
sa...@gmail.com <sa...@gmail.com> #65
sa...@gmail.com <sa...@gmail.com> #66
al...@gmail.com <al...@gmail.com> #67
az...@gmail.com <az...@gmail.com> #68
[Deleted User] <[Deleted User]> #69
10...@gmail.com <10...@gmail.com> #70
[Deleted User] <[Deleted User]> #71
ka...@gmail.com <ka...@gmail.com> #72
[Deleted User] <[Deleted User]> #73
gi...@gmail.com <gi...@gmail.com> #76
gi...@gmail.com <gi...@gmail.com> #77
..and JR of you still want to be with some that evil to hurt little 14 and 12 year old girls go for it. And be sure and bring your gun like you promised in your encrypted letter I decoded.....I wasnt scared when I drove to Texas for kayla and my front door is open every night . So if that's who you are so be it I'm scared of no man! I just hope your not that stupid in both manners frankly but do as ye will. And I'll be waiting.
ab...@gmail.com <ab...@gmail.com> #78
انتهاك خصوصية
Description
Platform-tools rev.25.0.4
Steps to reproduce:
1. Run "adb sideload <file>".
2. Error is here.
On Platform-tools rev.25.0.3 its fine.