更新了导航框架并出现错误 - "getActionId overrides nothing"

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

我已将导航框架从 2.3.5 更新到 2.4.0-alpha01 版本。我将它与 Safe Args gradle 插件一起使用。更新后,我开始收到 'getActionId' overrides nothing'getArguments' overrides nothing 错误。

我认为发生这种情况是因为 Safe Args 在生成方向 类 时不正确地覆盖了 NavDirectionsactionIdarguments 字段。

例如,这是正在生成的:

 public override fun getActionId(): Int =
        R.id.action_navigation_articles_to_articleReaderFragment

这是应该生成的:

public override val actionId: Int = R.id.action_navigation_articles_to_articleReaderFragment

如何获得安全参数以生成正确的构建器类?

原来这 bug 已经有一段时间了。

在我发布这个问题的一天后,2.4.0-alpha02 Navigation 发布了这个错误的修复程序:

Safe Args no longer crashes when attempting to generate direction properties in Kotlin. (Id2416, b/188564435)

只需更新到 2.4.0-alpha02 版本即可修复。

更新到 2.5.0-alpha01 版本和 wrapper-properties distributionUrl -7.0.2-bin.zip 进行修复。