Status Update
Comments
il...@google.com <il...@google.com> #2
We've found the issue in alpha10 and are working on a fix.
ap...@google.com <ap...@google.com> #3
Branch: androidx-master-dev
commit 37ed64d4de87bd4a4365f5c0dfee7b33c8043013
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Wed Jan 23 15:46:00 2019
Add missing import of parent Directions class in generated Safe Args.
When generating a parent direction action method in a child directions
class,correctly import the parent direction if its located in another
package. Both JavaPoet and KotlinPoet generate import statements but the
NavWriters were incorrectly creating the class name of the parent type,
specifically it missed the package name which caused the import to be
missing.
Bug: 123307342
Test: ./gradlew navigation:navigation-safe-args-gradle-plugin:test \
navigation:navigation-safe-args-generator:test
Change-Id: Ibeda7a7ec6f31bb1c860dfe1f5cd2a7e7ea6d47d
M navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/java/JavaNavWriter.kt
M navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/kotlin/KotlinNavWriter.kt
M navigation/safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/NavGeneratorTest.kt
M navigation/safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/NavParserTest.kt
M navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested/LoginFragmentDirections.java
M navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested/RegisterFragmentDirections.java
M navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_overridden_action/InnerSettingsFragmentDirections.java
M navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_overridden_action/SettingsFragmentDirections.java
M navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested/LoginFragmentDirections.kt
M navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested/RegisterFragmentDirections.kt
M navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_overridden_action/InnerSettingsFragmentDirections.kt
M navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_overridden_action/SettingsFragmentDirections.kt
M navigation/safe-args-generator/src/tests/test-data/nested_login_test.xml
M navigation/safe-args-gradle-plugin/src/test/test-data/app-project-kotlin/src/main/res/navigation/nav_nested_test.xml
A navigation/safe-args-gradle-plugin/src/test/test-data/app-project/src/main/res/navigation/nav_nested_test.xml
il...@google.com <il...@google.com>
[Deleted User] <[Deleted User]> #4
[Deleted User] <[Deleted User]> #5
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