[todo-mvp-clean] sync fail -> FAILURE: Build failed with an exception
FAILURE: Build failed with an exception.
- What went wrong: A problem occurred configuring root project 'todoapp'.
Could not resolve all files for configuration ':classpath'. Could not find gradle.jar (com.android.tools.build:gradle:3.0.0). Searched in the following locations: https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.jar Could not find gradle-core.jar (com.android.tools.build:gradle-core:3.0.0). Searched in the following locations: https://jcenter.bintray.com/com/android/tools/build/gradle-core/3.0.0/gradle-core-3.0.0.jar Could not find builder.jar (com.android.tools.build:builder:3.0.0). Searched in the following locations: https://jcenter.bintray.com/com/android/tools/build/builder/3.0.0/builder-3.0.0.jar Could not find lint.jar (com.android.tools.lint:lint:26.0.0). Searched in the following locations: https://jcenter.bintray.com/com/android/tools/lint/lint/26.0.0/lint-26.0.0.jar Could not find lint-checks.jar (com.android.tools.lint:lint-checks:26.0.0). Searched in the following locations: https://jcenter.bintray.com/com/android/tools/lint/lint-checks/26.0.0/lint-checks-26.0.0.jar Could not find lint-api.jar (com.android.tools.lint:lint-api:26.0.0). Searched in the following locations: https://jcenter.bintray.com/com/android/tools/lint/lint-api/26.0.0/lint-api-26.0.0.jar Could not find uast.jar (com.android.tools.external.org-jetbrains:uast:26.0.0). Searched in the following locations: https://jcenter.bintray.com/com/android/tools/external/org-jetbrains/uast/26.0.0/uast-26.0.0.jar Could not find gradle-api.jar (com.android.tools.build:gradle-api:3.0.0). Searched in the following locations: https://jcenter.bintray.com/com/android/tools/build/gradle-api/3.0.0/gradle-api-3.0.0.jar Could not find compilerCommon.jar (com.android.databinding:compilerCommon:3.0.0). Searched in the following locations: https://jcenter.bintray.com/com/android/databinding/compilerCommon/3.0.0/compilerCommon-3.0.0.jar Could not find sdk-common.jar (com.android.tools:sdk-common:26.0.0). Searched in the following locations: https://jcenter.bintray.com/com/android/tools/sdk-common/26.0.0/sdk-common-26.0.0.jar Could not find sdklib.jar (com.android.tools:sdklib:26.0.0). Searched in the following locations: https://jcenter.bintray.com/com/android/tools/sdklib/26.0.0/sdklib-26.0.0.jar Could not find repository.jar (com.android.tools:repository:26.0.0). Searched in the following locations: https://jcenter.bintray.com/com/android/tools/repository/26.0.0/repository-26.0.0.jar Could not find tracker.jar (com.android.tools.analytics-library:tracker:26.0.0). Searched in the following locations: https://jcenter.bintray.com/com/android/tools/analytics-library/tracker/26.0.0/tracker-26.0.0.jar Could not find shared.jar (com.android.tools.analytics-library:shared:26.0.0). Searched in the following locations: https://jcenter.bintray.com/com/android/tools/analytics-library/shared/26.0.0/shared-26.0.0.jar Could not find protos.jar (com.android.tools.analytics-library:protos:26.0.0). Searched in the following locations: https://jcenter.bintray.com/com/android/tools/analytics-library/protos/26.0.0/protos-26.0.0.jar Could not find builder-model.jar (com.android.tools.build:builder-model:3.0.0). Searched in the following locations: https://jcenter.bintray.com/com/android/tools/build/builder-model/3.0.0/builder-model-3.0.0.jar Could not find builder-test-api.jar (com.android.tools.build:builder-test-api:3.0.0). Searched in the following locations: https://jcenter.bintray.com/com/android/tools/build/builder-test-api/3.0.0/builder-test-api-3.0.0.jar Could not find layoutlib-api.jar (com.android.tools.layoutlib:layoutlib-api:26.0.0). Searched in the following locations: https://jcenter.bintray.com/com/android/tools/layoutlib/layoutlib-api/26.0.0/layoutlib-api-26.0.0.jar Could not find apksig.jar (com.android.tools.build:apksig:3.0.0). Searched in the following locations: https://jcenter.bintray.com/com/android/tools/build/apksig/3.0.0/apksig-3.0.0.jar Could not find baseLibrary.jar (com.android.databinding:baseLibrary:3.0.0). Searched in the following locations: https://jcenter.bintray.com/com/android/databinding/baseLibrary/3.0.0/baseLibrary-3.0.0.jar Could not find annotations.jar (com.android.tools:annotations:26.0.0). Searched in the following locations: https://jcenter.bintray.com/com/android/tools/annotations/26.0.0/annotations-26.0.0.jar Could not find intellij-core.jar (com.android.tools.external.com-intellij:intellij-core:26.0.0). Searched in the following locations: https://jcenter.bintray.com/com/android/tools/external/com-intellij/intellij-core/26.0.0/intellij-core-26.0.0.jar
-
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
-
Get more help at https://help.gradle.org
CONFIGURE FAILED in 0s Could not find gradle.jar (com.android.tools.build:gradle:3.0.0). Searched in the following locations: https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.jar
Issue Gradle sync fails because dependencies can't be downloaded due to:
Usage of JCenter, which has been deprecated.
You're offline or JCenter is no longer serving old artifacts.
Typical errors:
Could not find gradle.jar (com.android.tools.build:gradle:3.0.0) ... Searched in the following locations: https://jcenter.bintray.com/... How to Fix It
- Switch from JCenter to MavenCentral or Google In your root build.gradle:
buildscript { repositories { google() mavenCentral() // Replace jcenter() with this } dependencies { classpath "com.android.tools.build:gradle:7.4.2" // Use a supported version } }
allprojects { repositories { google() mavenCentral() } } 2. Upgrade Gradle & Plugin Versions Older versions may no longer be available. Use:
Gradle plugin: at least 7.4.2
Gradle wrapper: at least 7.6
In gradle/wrapper/gradle-wrapper.properties:
distributionUrl=https://services.gradle.org/distributions/gradle-7.6-bin.zip 3. Enable Online Mode make sure Android Studio is not in Offline Mode:
Go to File > Settings > Build, Execution, Deployment > Build Tools > Gradle
Uncheck "Offline work"
- Sync Again Click Sync Now or run:
./gradlew build --refresh-dependencies Optional: Migrate the project If the code is outdated, consider:
Cloning the latest todo-mvp from the official repo.
Replacing deprecated APIs and libraries.