I tried to sync my project in android studio with gradle files but it failed and I got the above message "Grade sync failed: Unresolved dependencies".
I also got these errors in the build tab:
- ERROR: Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve androidx.fragment:fragment:[1.2.0].
Show Details
Affected Modules: app - ERROR: Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve androidx.fragment:fragment:[1.2.0].
Show Details
Affected Modules: app - ERROR: Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve androidx.fragment:fragment:[1.2.0].
Show Details
Affected Modules: app
These are my dependencies in build.gradle (Module:app)
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.2.0'
implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.navigation:navigation-fragment-ktx:2.2.1'
implementation 'androidx.navigation:navigation-ui-ktx:2.2.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.5'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.5'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.2.0'