4

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: enter image description here

Filip
  • 101
  • 3
  • 8

2 Answers2

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
  • 1
    I 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