When I try to run my project in Android Studio, I encounter the following error:
A problem occurred configuring root project 'MyProject'.
> Could not resolve all files for configuration ':classpath'.
The error lists multiple dependencies with their download links, but instead of automatically downloading them, Android Studio immediately throws errors.
For example, the error states:
> Could not find databinding-ktx-8.7.3.aar (androidx.databinding:databinding-ktx:8.7.3).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/androidx/databinding/databinding-ktx/8.7.3/databinding-ktx-8.7.3.aar
This behavior is strange because:
1.If I manually click the download links, the files can be downloaded without any issues.
2.Android Studio appears to skip the download process entirely and shows these red errors within milliseconds.
A snippet of the full error output is:
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:dataBindingMergeDependencyArtifactsDebug'.
> Could not resolve all files for configuration ':app:debugCompileClasspath'.
> Failed to transform databinding-ktx-8.7.3.aar (androidx.databinding:databinding-ktx:8.7.3) to match attributes {artifactType=android-databinding, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-api}.
> Could not find databinding-ktx-8.7.3.aar (androidx.databinding:databinding-ktx:8.7.3).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/androidx/databinding/databinding-ktx/8.7.3/databinding-ktx-8.7.3.aar
Similar errors are listed for other dependencies like navigation-common, material, and appcompat.
what I have done is:
I have checked my connection, no problem with that.
I have removed cache of gradle.
I have uninstall and re-install the android studio.
Also deleted all caches of android studio and gradle cache and sdk folder and let android studio to download them again.
I have also changed sdk version of my project from 20 to 35 and cleaned build and rebuild the project with each sdk version.
I have also tried clean build and invalidate cache in android studio.
I used to change ndk and build tools.
Despite these steps, the issue persists. It seems Android Studio is not attempting to download the dependencies at all.
rozhiyak mohamadi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.