Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

Gradle cannot resolve the files of :app:debugRuntimeClasspath after adding a dependency

ErrorCould not resolve all files for configuration ':app:debugRuntimeClasspath'.

Short answer

After you add a dependency, Gradle must download it and everything it needs. This error means one artifact in the chain could not be found. Read the 'Could not find' line under it: it names the artifact and the repositories searched. The cause is a missing repository, a version that does not exist, or an artifact that is not in Google's Maven repository.

  • Applies to Android Studio current stable, Android Gradle plugin 8.x, Gradle 8.x
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Print the resolved tree for the failing configuration. Lines marked FAILED name the artifact Gradle could not get.

    ./gradlew :app:dependencies --configuration debugRuntimeClasspath
  2. 2Match what you see, then jump to its fix

    1. 1Could not find ... followed by a list of searched locations that lacks the hostThe repository that hosts the artifact is not declaredFix
    2. 2Could not find group:name:version and the repositories are correctThe group, name or version does not existFix
    3. 3An old guide's version of a Google or AndroidX library fails while newer versions resolveAn older library version is missing from Google's Maven repositoryFix

What does the error look like?

  • Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
  • Could not find com.example:library:1.0.0.

Cause 1 of 3

The repository that hosts the artifact is not declared

1Check

Gradle looks only in the dependencyResolutionManagement repositories of settings.gradle. Compare that block with the home of the library you added: AndroidX and Firebase come from google(), most other libraries from mavenCentral().

grep -n -A8 "dependencyResolutionManagement" settings.gradle settings.gradle.kts 2>/dev/null

2Fix

Add the missing repository to that block and sync.

dependencyResolutionManagement {
    repositories {
        google()
        mavenCentral()
    }
}

3Verify

The tree shows the artifact with a version instead of FAILED.

./gradlew :app:dependencies --configuration debugRuntimeClasspath | grep FAILED

Confirmed by developer.android.com

Did this fix it?

Cause 2 of 3

The group, name or version does not exist

1Check

A typo, or a version that was never released, gives the same message as a missing repository. Google's Maven repository publishes a version list for each group, so you can compare against it for AndroidX and Firebase libraries.

curl -s https://maven.google.com/androidx/appcompat/group-index.xml | head -n 20

2Fix

Copy the coordinates and the latest version from the library's own release page and correct the line in your build file or version catalog.

dependencies {
    implementation("androidx.appcompat:appcompat:1.7.0")
}

3Verify

Sync; the dependency resolves.

./gradlew :app:dependencies --configuration debugRuntimeClasspath | grep appcompat

Confirmed by developer.android.com

Did this fix it?

Cause 3 of 3

An older library version is missing from Google's Maven repository

1Check

Android's docs state that older versions of Google libraries are not in the Maven repository and must come from the offline repository in the SDK Manager.

ls "$ANDROID_HOME/extras"

2Fix

The simple fix is to move to a current version. If you must keep the old one, install the Google Repository package from the SDK Manager first.

dependencies {
    implementation("androidx.appcompat:appcompat:1.7.0")
}

3Verify

A clean build gets past dependency resolution.

./gradlew clean :app:assembleDebug

Confirmed by developer.android.com

Did this fix it?

How do I stop it coming back?

  • Keep the repository list in settings.gradle only and review it when you add an SDK.
  • Take coordinates from the library's release notes, not from copied snippets.
  • Use a version catalog so one version string serves every module.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Mobile apps

Android Studio cannot pair the phone over Wi-Fi

The Pair devices over Wi-Fi dialog lists no device

Wireless pairing needs the phone on Android 11 or higher and on the same Wi-Fi network as the computer, with current Platform-Tools.

4 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.