Reputation: 7331
I have updated the Navigation framework from 2.3.5 to the 2.4.0-alpha01 version. I use it with Safe Args gradle plugin. After update, I started getting 'getActionId' overrides nothing
and 'getArguments' overrides nothing
errors.
I think this is happening because Safe Args is overriding the actionId
and arguments
fields of NavDirections
improperly when generating the Direction classes.
For example, this is what is being generated:
public override fun getActionId(): Int =
R.id.action_navigation_articles_to_articleReaderFragment
This is what should be generated:
public override val actionId: Int = R.id.action_navigation_articles_to_articleReaderFragment
How can I get the Safe Args to generate proper builder classes?
Upvotes: 6
Views: 1960
Reputation: 26
update to 2.5.0-alpha01 version and wrapper-properties distributionUrl -7.0.2-bin.zip for a fix.
Upvotes: 0
Reputation: 7331
Turns out this was a known bug for some time.
And right after a day after I posted this question, 2.4.0-alpha02 Navigation was released with a fix for this bug:
Safe Args no longer crashes when attempting to generate direction properties in Kotlin. (Id2416, b/188564435)
Just update to 2.4.0-alpha02 version for a fix.
Upvotes: 4