Updated the Navigation framework and getting error - "getActionId overrides nothing"
Asked Answered
L

2

6

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?

Ledet answered 2/6, 2021 at 12:29 Comment(0)
L
4

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.

Ledet answered 3/6, 2021 at 9:35 Comment(1)
latest version - 2.4.0-alpha06Faustofaustus
I
0

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

Impale answered 6/2, 2022 at 15:17 Comment(1)
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.Mallorca

© 2022 - 2024 — McMap. All rights reserved.