Maaz Zindani

Loading the index…

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

Flutter Android build: Could not resolve all artifacts for a plugin's classpath

ErrorCould not resolve all artifacts for configuration ':image_picker_android:debugUnitTestRuntimeClasspath'

Short answer

This message means Gradle could not download one dependency of the plugin module. The lines under it name the module and the reason. The usual causes are a repository missing from the settings, a stale or negative cache, Gradle running in offline mode, or a proxy that blocks the download. Read the line below first.

  • Applies to Flutter 3.35, Gradle 8.x, Android Gradle Plugin 8.x
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Rerun the build with full stack output so the real reason under the headline shows. Look for the module name and words such as 'not found', 'timed out' or 'offline'.

    cd android && ./gradlew assembleDebug --stacktrace
  2. 2Match what you see, then jump to its fix

    1. 1The module named under the headline is a Google or AndroidX libraryA repository is missing from the Gradle settingsFix
    2. 2The module exists online but Gradle keeps reporting it as not found, or it worked before a repository was fixedThe Gradle cache holds a stale or missing-module entryFix
    3. 3The build works only on a machine or run where the module is already cachedGradle is running with --offlineFix
    4. 4The failure happens only on one network, such as an office or VPNA proxy sits between the machine and the repositoriesFix

What does the error look like?

  • Could not resolve all artifacts for configuration ':image_picker_android:debugUnitTestRuntimeClasspath'

Cause 1 of 4

A repository is missing from the Gradle settings

1Check

Android's documentation says Gradle searches the repositories listed in the dependencyResolutionManagement block of settings.gradle, in order. A library from Google's Maven repository only resolves if google() is there.

grep -n -A6 "repositories" android/settings.gradle android/build.gradle

2Fix

List google() and mavenCentral() in the repositories block that Gradle really uses.

repositories {
    google()
    mavenCentral()
}

3Verify

Run the same Gradle task again.

cd android && ./gradlew assembleDebug

Confirmed by developer.android.com

Did this fix it?

Cause 2 of 4

The Gradle cache holds a stale or missing-module entry

1Check

Gradle's caching guide says its metadata cache also records that a module was absent from a repository, so Gradle does not ask again until the entry is refreshed.

ls ~/.gradle/caches/modules-2

2Fix

Force a fresh resolve against all repositories. Gradle only re-downloads files whose checksums differ.

cd android && ./gradlew assembleDebug --refresh-dependencies

3Verify

The build passes without the resolution error.

cd android && ./gradlew assembleDebug

Confirmed by docs.gradle.org

Did this fix it?

Cause 3 of 4

Gradle is running with --offline

1Check

With --offline Gradle makes no network requests and fails when a needed module is not already in the cache. Check the command, the IDE setting and your gradle.properties.

grep -rn "offline" android/gradle.properties ~/.gradle/gradle.properties 2>/dev/null

2Fix

Turn offline mode off (in Android Studio's Gradle settings, or remove the flag), so Gradle may download the missing module.

cd android && ./gradlew assembleDebug

3Verify

The first online run downloads the artifact and later runs use the cache.

cd android && ./gradlew assembleDebug

Confirmed by docs.gradle.org

Did this fix it?

Cause 4 of 4

A proxy sits between the machine and the repositories

1Check

Gradle takes proxy settings from standard JVM properties written with a systemProp prefix in gradle.properties. Look for them in the user-level file.

grep -n "proxy" ~/.gradle/gradle.properties android/gradle.properties 2>/dev/null

2Fix

Add or correct the proxy host and port for both http and https, and list hosts that bypass the proxy.

# ~/.gradle/gradle.properties
systemProp.http.proxyHost=proxy.example.com
systemProp.http.proxyPort=8080
systemProp.https.proxyHost=proxy.example.com
systemProp.https.proxyPort=8080

3Verify

Run the build again from a fresh terminal.

cd android && ./gradlew assembleDebug --refresh-dependencies

Confirmed by docs.gradle.org

Did this fix it?

How do I stop it coming back?

  • Declare google() and mavenCentral() once in settings.gradle, as Android's repository guide shows.
  • Use --refresh-dependencies after fixing a repository, not just a rerun.
  • Keep proxy settings in the user-level gradle.properties so they stay out of the project.

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

Google Play says the app does not support 16 KB memory pages

check_elf_alignment.sh reports UNALIGNED for a library under lib/arm64-v8a

Google Play requires apps that target Android 15 or higher and ship native .so libraries to run on devices with 16 KB memory pages; from 1 February 2027 it will block updates that do not.

5 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.