Status Update
Comments
il...@google.com <il...@google.com> #2
From the other issue:
note that it is never the right approach to attach a
<deeplink>
to an<activity>
destination as that will never give you the right behavior when using anon another app's task (where the system back should immediately take the user back to the app that triggered your deep link). Instead, you should attach your deep link directly to your second activity (either by manually writing the appropriate implicit deep link <intent-filter>
or by adding the<deeplink>
to the start destination of a nav host in that second activity).
A lint error saying as such when a <deepLink>
element is added in Navigation XML would go a really long way to avoiding this case. Our navigation-runtime-lint
artifact that would contain this check.
ap...@google.com <ap...@google.com> #3
We have some
il...@google.com <il...@google.com>
[Deleted User] <[Deleted User]> #5
Branch: androidx-main
commit cd77b4bbe312dd8892dfbb3c662344d13a96c82d
Author: Julia McClellan <juliamcclellan@google.com>
Date: Thu Apr 14 15:31:46 2022
Deep link in activity destination in navigation lint
Test: Included tests of API version and the lint rule
Bug: 178403185
Change-Id: Ic15a5ec165620b7ef5b3f03538cc83b5576add8d
A navigation/navigation-runtime-lint/src/main/java/androidx/navigation/runtime/lint/DeepLinkInActivityDestinationDetector.kt
A navigation/navigation-runtime-lint/src/test/java/androidx/navigation/runtime/lint/ApiLintVersionsTest.kt
M settings.gradle
A navigation/navigation-runtime-lint/build.gradle
M navigation/navigation-runtime/build.gradle
A navigation/navigation-runtime-lint/src/main/java/androidx/navigation/runtime/lint/NavigationRuntimeIssueRegistry.kt
A navigation/navigation-runtime-lint/src/test/java/androidx/navigation/runtime/lint/DeepLinkInActivityDestinationDetectorTest.kt
A navigation/navigation-runtime-lint/src/main/resources/META-INF/services/com.android.tools.lint.client.api.IssueRegistry
il...@google.com <il...@google.com> #6
[Deleted User] <[Deleted User]> #7
pe...@gmail.com <pe...@gmail.com> #8
co...@gmail.com <co...@gmail.com> #9
If you're working with Jetpack Navigation in Android and the generated classes don't import MainNavDirections, it usually points to an issue with your setup or the
co...@gmail.com <co...@gmail.com> #10
It sounds like you are dealing with a coding issue, possibly in a web development or React project. If MainNavDirections isn't being imported in generated classes, you may need to explicitly import it in your files. If you provide more specific details about your setup and the context
Description
Version used: 1.0.0-alpha01
Devices/Android versions reproduced on: N/A – compilation/build issue
If this is a bug in the library, we would appreciate if you could attach:
- Sample project to trigger the issue.
- A screenrecord or screenshots showing the issue (if UI related).
Steps to reproduce:
- Add a global action to a fragment that's in a different package than the main app package