Flutter Android build: Could not resolve all artifacts for a plugin's classpath
Could 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.
Fix it fast
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 --stacktrace2Match what you see, then jump to its fix
- 1
The module named under the headline is a Google or AndroidX libraryA repository is missing from the Gradle settingsFix - 2
The 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
The build works only on a machine or run where the module is already cachedGradle is running with --offlineFix - 4
The failure happens only on one network, such as an office or VPNA proxy sits between the machine and the repositoriesFix
- 1
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.gradle2Fix
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 assembleDebugConfirmed by developer.android.com
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-22Fix
Force a fresh resolve against all repositories. Gradle only re-downloads files whose checksums differ.
cd android && ./gradlew assembleDebug --refresh-dependencies3Verify
The build passes without the resolution error.
cd android && ./gradlew assembleDebugConfirmed by docs.gradle.org
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/null2Fix
Turn offline mode off (in Android Studio's Gradle settings, or remove the flag), so Gradle may download the missing module.
cd android && ./gradlew assembleDebug3Verify
The first online run downloads the artifact and later runs use the cache.
cd android && ./gradlew assembleDebugConfirmed by docs.gradle.org
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/null2Fix
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=80803Verify
Run the build again from a fresh terminal.
cd android && ./gradlew assembleDebug --refresh-dependenciesConfirmed by docs.gradle.org
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:
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- QistLockA NestJS and React SaaS driving an Android Device Owner agent that locks financed phones when payments lapse.
- Dispatch ProA real-time logistics platform: Flutter apps, Spring Boot services and a Kafka event pipeline on AWS.
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 fixMobile apps
Gradle cannot find com.google.firebase:firebase-analytics-ktx
Required by: project :app
Firebase moved the Kotlin extensions into the main modules and stopped releasing the -ktx modules in July 2025.
2 causes, each with a fixMobile apps
Gradle cannot create LibraryVariantBuilderImpl in a Flutter Android build
Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl
This error appears when the Android Gradle plugin (AGP) cannot run in the Gradle or IDE you use.
3 causes, each with a fixMobile apps
Flutter release build cannot open the keystore: HmacPBESHA256 not available
Algorithm HmacPBESHA256 not available
The keystore is a PKCS12 file protected by a newer algorithm than the Java that is reading it understands.
3 causes, each with a fixMobile apps
Android install error: the package conflicts with an existing package of the same name
The package conflicts with an existing package by the same name
Android allows only one app per application ID, and an update must be signed with the same certificate as the installed version.
3 causes, each with a fixMobile apps
Android resource linking fails with resource android:attr/lStar not found
error: failed linking references.
The lStar attribute exists only from Android API 31.
2 causes, each with a fix