Issue
I got this issue after upgrading from version 2.3 to 2.4.0-alpha02. The new version should contain a fix, but it did not work for me. For reference, my actions are defined like so:
<action
android:id="@+id/action_from_to_destination"
app:destination="@id/destination" />
Solution
Thanks to @ianhanniballake, I figured out what the problem was. All androidx.navigation dependencies should have the same version. In my case the Safe Args Plugin was still at version 3.5. Issue resolved by upgrading it to 2.4.0-alpha02.
If anyone ran into the same issue, here is what you need to avoid similar problems in the future:
In build.gradle define the following under buildscript:
ext.navigation_version="2.4.0-alpha02"
and under dependencies:
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$navigation_version"
In build.gradle (:app), under dependencies:
implementation "androidx.navigation:navigation-runtime-ktx:$navigation_version"
implementation "androidx.navigation:navigation-fragment-ktx:$navigation_version"
implementation "androidx.navigation:navigation-ui-ktx:$navigation_version"
Now you only need to change the navigation version one place.
Answered By - shko
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.