Status Update
Comments
ac...@gmail.com <ac...@gmail.com> #2
il...@google.com <il...@google.com>
sh...@gmail.com <sh...@gmail.com> #3
Firstly, thank you! Finally we get the multi stack support. I tried 2.4.0-alpha01 but failed to compile. All the generated Actionxxxxx class for my nav actions with arguments are having error "Class 'Actionxxxxx' is not abstract and does not implement abstract member public abstract val actionId: Int defined in androidx.navigation.NavDirections".
ap...@google.com <ap...@google.com> #4
Branch: androidx-main
commit d05079ecf245da3356cfd24023ce5ccc7328f37a
Author: Jeremy Woods <jbwoods@google.com>
Date: Thu May 20 10:23:36 2021
Fix safe args directions class generation
Since navigaiton is now is Kotlin, the safe args kotlin plugin needs to
override the property instead of getter methods since the getters don't
exist in kotlin.
RelNote: "Safe Args no longer crashes when attempting to generate
direction functions in kotlin with Navigation 2.4.0-alpha01"
Test: ./gradlew --rerun-tasks navigation:navigation-safe-args-gradle-plugin:test
Bug: 188564435
Change-Id: Id2416d7d7c52888fb9ec9bdbb80afcc7d2a1bf3e
M navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/kotlin/KotlinNavWriter.kt
M navigation/navigation-safe-args-generator/src/test/test-data/expected/kotlin_nav_writer_test/MainFragmentDirections.kt
M navigation/navigation-safe-args-generator/src/test/test-data/expected/kotlin_nav_writer_test/Next.kt
M navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/kotlin/nested_overridden_action/InnerSettingsDirections.kt
M navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/kotlin/nested_overridden_action/SettingsDirections.kt
M navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/kotlin/nested_same_action/SettingsDirections.kt
M navigation/navigation-safe-args-generator/src/test/test-data/expected/nav_generator_test/kotlin/nested_same_action/SettingsFragmentDirections.kt
il...@google.com <il...@google.com> #5
This has been fixed for Navigation 2.4.0-alpha02.
ed...@googlemail.com <ed...@googlemail.com> #6
I am unfortunately still seeing this as part of Navigation 2.4.0-alpha02
./gradlew :app:dependencies | grep navigation
+--- androidx.navigation:navigation-fragment-ktx:2.4.0-alpha02
| \--- androidx.navigation:navigation-fragment:2.4.0-alpha02
| +--- androidx.navigation:navigation-runtime:2.4.0-alpha02
| | +--- androidx.navigation:navigation-common:2.4.0-alpha02
The error I see is similar in nature to previously mentioned:
Class 'ActionHomeFragmentToDetailFragment' is not abstract and does not implement abstract member public abstract val actionId: Int defined in androidx.navigation.NavDirections e: HomeFragmentDirections.kt: (19, 12): 'getActionId' overrides nothing e: HomeFragmentDirections.kt: (22, 12): 'getArguments' overrides nothing
The source for this HomeFragmentDirections.kt is attached - if you need any further details please let me know
For reference, reverting to use the 'androidx.navigation.safeargs' instead of 'androidx.navigation.safeargs.kotlin' resolved this issue
tp...@gmail.com <tp...@gmail.com> #7
Working fine for me upgrading to 2.4.0-alpha02 made the generated actionId a val instead of a fun
public override val actionId: Int = R.id.action_leaderboard_to_userProfile
Did you happen to change androidx.navigation:navigation-safe-args-gradle-plugin to 2.4.0-alpha02 as well?
zh...@gmail.com <zh...@gmail.com> #8
Don't forget to clean/build after gradle sync
Description
Component used: Navigation
Version used: 2.4.0-alpha01
After update Navigation from 2.3.5 to 2.4.0-alpha01 I received this errors:
I think it because Safe-Args plugin codegen not updated to new structure of NavDirections (Kotlin val`s instead methods)