成绩同步失败:未解决的依赖项

问题描述 投票:0回答:1

我试图用gradle文件同步android studio中的项目,但是失败了,并且出现了上面的消息“ Grade sync failed:Unresolved依靠关系”。

我在构建标签中也遇到了这些错误:

  1. 错误:无法解析':app @ debugUnitTest / compileClasspath'的依赖项:无法解析androidx.fragment:fragment:[1.2.0]。显示详细资料受影响的模块:应用]
  2. 错误:无法解析':app @ debugAndroidTest / compileClasspath'的依赖关系:无法解析androidx.fragment:fragment:[1.2.0]。显示详细资料受影响的模块:应用]
  3. 错误:无法解析':app @ debug / compileClasspath'的依赖项:无法解析androidx.fragment:fragment:[1.2.0]。显示详细资料受影响的模块:应用]

这些是我在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'
android android-studio android-fragments kotlin kotlin-coroutines
1个回答
0
投票

嘿,我对此不太确定,我没有发现片段的任何依赖性

    def fragment_version = "1.2.4"

    // Java language implementation
    implementation "androidx.fragment:fragment:$fragment_version"
    // Kotlin
    implementation "androidx.fragment:fragment-ktx:$fragment_version"
    // Testing Fragments in Isolation
    implementation "androidx.fragment:fragment-testing:$fragment_version"
}```

    [dependencies are here][1]


  [1]: https://developer.android.com/jetpack/androidx/releases/fragment#declaring_dependencies
© www.soinside.com 2019 - 2024. All rights reserved.