Failed to resolve following three dependencies in Android studio

1.2k Views Asked by At
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"

...
}

When I add these three dependencies in build.gradle(Module) file of my project in android studio and sync it, I get 3 warnings of "failed to resolve" these three dependencies.

And when I run my project, I get this error:

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

I've checked for the versions of these dependencies, all the versions exist. I'm using them with kotlin version 1.5.0. What does it mean by "dependencies not resolving" and how should I resolve this issue?

1

There are 1 best solutions below

0
On

Gradle looks at multiple repositories to find your dependency. In your case, it didn't find those in any of the repositories you declared in your repositories section.

You can check for available versions: InstantSearch Android or Lifecycle