1
dependencies {
...

implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'

implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'

//Lifecycle Extensions
    implementation "android.arch.lifecycle:extensions:2.1.1"

//VegaLayoutManager
    implementation "com.stone.vega.library:VegaLayoutManager:1.0.6"

//Algolia Search
    implementation "com.algolia:instantsearch-android:2.4.0"

...
}

当我在 android studio 的项目的 build.gradle(Module) 文件中添加这三个依赖项并同步它时,我收到 3 个“无法解析”这三个依赖项的警告。

当我运行我的项目时,我收到了这个错误:

Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find android.arch.lifecycle:extensions:2.1.1.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/android/arch/lifecycle/extensions/2.1.1/extensions-2.1.1.pom
       - https://repo.maven.apache.org/maven2/android/arch/lifecycle/extensions/2.1.1/extensions-2.1.1.pom
       - https://jitpack.io/android/arch/lifecycle/extensions/2.1.1/extensions-2.1.1.pom
       - https://maven.google.com/android/arch/lifecycle/extensions/2.1.1/extensions-2.1.1.pom
     Required by:
         project :app
   > Could not find com.stone.vega.library:VegaLayoutManager:1.0.6.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/stone/vega/library/VegaLayoutManager/1.0.6/VegaLayoutManager-1.0.6.pom
       - https://repo.maven.apache.org/maven2/com/stone/vega/library/VegaLayoutManager/1.0.6/VegaLayoutManager-1.0.6.pom
       - https://jitpack.io/com/stone/vega/library/VegaLayoutManager/1.0.6/VegaLayoutManager-1.0.6.pom
       - https://maven.google.com/com/stone/vega/library/VegaLayoutManager/1.0.6/VegaLayoutManager-1.0.6.pom
     Required by:
         project :app
   > Could not find com.algolia:instantsearch-android:2.4.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/algolia/instantsearch-android/2.4.0/instantsearch-android-2.4.0.pom
       - https://repo.maven.apache.org/maven2/com/algolia/instantsearch-android/2.4.0/instantsearch-android-2.4.0.pom
       - https://jitpack.io/com/algolia/instantsearch-android/2.4.0/instantsearch-android-2.4.0.pom
       - https://maven.google.com/com/algolia/instantsearch-android/2.4.0/instantsearch-android-2.4.0.pom
     Required by:
         project :app
Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

我检查了这些依赖项的版本,所有版本都存在。我将它们与 kotlin 1.5.0 版一起使用。“依赖关系未解决”是什么意思,我应该如何解决这个问题?

4

1 回答 1

1

Gradle 会查看多个存储库以找到您的依赖项。在您的情况下,它没有在您在您的repositories部分中声明的任何存储库中找到那些。

您可以检查可用版本:InstantSearch AndroidLifecycle

于 2021-10-06T09:05:44.263 回答