When I build my Android Studio app, I got an error "Could not find android.arch.navigation:navigation-fragment-ktx:2.3.5". But I have implemented "android.arch.navigation:navigation-fragment-ktx:2.3.5". The error appeared after updating gradle.
Here is whole error:
Asked
Active
Viewed 4,341 times
4

Filip
- 101
- 3
- 8
-
Have you added `apply plugin: 'androidx.navigation.safeargs.kotlin'` at the top of your build gradle? – Mohit Ajwani May 09 '21 at 06:46
-
Yes, but nothing changed – Filip May 09 '21 at 06:52
-
Did you add the `"androidx.navigation:navigation-safe-args-gradle-plugin:2.3.5"` plugin dependency in your project `build.gradle` file? – Mohit Ajwani May 09 '21 at 06:56
-
Yes, but it also didn't change anything – Filip May 09 '21 at 07:01
-
check this answer. https://stackoverflow.com/questions/50284338/could-not-find-androidx-navigationsafe-args-gradle-plugin1-0-0-alpha01 – Mohit Ajwani May 09 '21 at 07:15
-
None of the answers didn't work for me. – Filip May 09 '21 at 07:23
-
As stated earlier down grade dependency to 4.1.3 ic could be found under project level gradle file dependencies class path – Arsh Ansari Jul 15 '21 at 11:17
2 Answers
3
I solved this by downgrading the gradle plugin to 4.1.3
in build.graddle project level:
From this:
dependencies {
classpath 'com.android.tools.build:gradle:4.2.0'
}
to this:
dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
}

Damian Vaz
- 31
- 3
-
1I need to use jetpack compose, so the minimum version should be 4.2.2. and there isn't any solution for that!!! – FarshidABZ Aug 12 '21 at 09:11
3
Try using Android Jetpack stuff.
Replace:
implementation "android.arch.navigation:navigation-fragment-ktx:2.3.5"
implementation "android.arch.navigation:navigation-ui-ktx:2.3.5"
with
implementation "androidx.navigation:navigation-fragment-ktx:2.3.5"
implementation "androidx.navigation:navigation-ui-ktx:2.3.5"
in the module-level (app) build.gradle file.

Wojciech Fornal
- 1,265
- 11
- 11