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版本一起使用。";依赖项未解析";我应该如何解决这个问题?
Gradle查看多个存储库以查找您的依赖项。在您的案例中,它在您在repositories
部分中声明的任何存储库中都找不到这些存储库。
您可以查看可用版本:InstantSearch Android或Lifecycle