5

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?

SpiralDev
  • 7,011
  • 5
  • 28
  • 42

2 Answers2

3

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.

SpiralDev
  • 7,011
  • 5
  • 28
  • 42
0

update to 2.5.0-alpha01 version and wrapper-properties distributionUrl -7.0.2-bin.zip for a fix.

CoderBusra
  • 16
  • 2
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Feb 06 '22 at 18:31