Short answer
Read the “Could not find” line and the “Searched in the following locations” list under it. If the library is not on google() or mavenCentral(), add the repository it is published to in settings.gradle. If the list includes jcenter(), replace it, because JCenter is read-only. If the version does not exist, fix the typo or pick a published version. If nothing downloads at all, turn off Gradle offline mode, check the proxy settings, and run ./gradlew --refresh-dependencies.
Why Gradle can’t download it, and the fix
01
The repository is not declared
“Gradle looks for the files in whichever online repositories are specified in the dependencyResolutionManagement { repositories {...} } block of your settings.gradle file.” Android Developers, Manage remote repositories
Gradle only searches the repositories you list. Newer projects list them in settings.gradle (dependencyResolutionManagement); Flutter and React Native projects often still list them in android/build.gradle under allprojects { repositories { ... } }. Libraries published to JitPack or a vendor’s own Maven repository need that repository added in whichever place your project uses.
// settings.gradle.kts dependencyResolutionManagement { repositories { google() mavenCentral() maven { url = uri("https://jitpack.io") } } } // Groovy (build.gradle): maven { url "https://jitpack.io" }02
An old project still relies on JCenter
“The JCenter repository, which was included by default in the past, became read-only on March 31st, 2021.” Android Developers, Manage remote repositories
Older projects and plugins list jcenter(), and some old library versions only exist there. Replace jcenter() with mavenCentral() and update libraries to versions published on Maven Central.
03
Project repositories are blocked
With repositoriesMode set to FAIL_ON_PROJECT_REPOS, repositories declared in a module’s build.gradle are ignored or rejected. Move them into dependencyResolutionManagement in settings.gradle so every module uses them.
04
The Android Gradle plugin itself can’t be found (:classpath)
“The order in which you list each repository determines the order in which Gradle searches the repositories for each project dependency.” Android Developers, Manage remote repositories
Could not resolve all files for configuration ':classpath' or Could not find com.android.tools.build:gradle is about build plugins, not app libraries. Plugins come from the pluginManagement repositories in settings.gradle (or buildscript { repositories } in older projects), so add google(), mavenCentral() and gradlePluginPortal() there, and check the plugin version exists.
// settings.gradle.kts pluginManagement { repositories { google() mavenCentral() gradlePluginPortal() } }05
Flutter: io.flutter:flutter_embedding not found
The Flutter engine artifacts come from Flutter’s own Maven repository, which the Flutter Gradle plugin normally adds. A custom repositories block with FAIL_ON_PROJECT_REPOS, or an old plugin setup, can leave it out. Run flutter clean and flutter pub get, update to the current Flutter Gradle plugin setup, or add https://storage.googleapis.com/download.flutter.io as a Maven repository.
06
Offline mode, a proxy or a version that does not exist
Gradle offline mode in Android Studio, a corporate proxy or a firewall stops every download. A typo in the version, or a version that was never published, fails only for that library. Check the version on the repository’s website, then refresh.
./gradlew build --refresh-dependencies
Checked against the vendor’s docs on : Android Developers: Manage remote repositories; Android Developers: Fix dependency resolution errors.
Rather hand it over?
Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.
- from $450App Fix TicketOne reproducible bug in an existing mobile or web app, diagnosed and fixed.See scope and start
- from $450AI-Built App RescueA Lovable, Bolt or Cursor app checked end to end in 3 days, then its worst problems fixed at a fixed price.No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way. This applies to the first 10 Launch Checks bought after October 30, 2026.See scope and start
Related: Android “Duplicate class found in modules” · Flutter “Gradle task assembleDebug failed” · Expo EAS build failed