Error: Could not resolve dependencies for com.android.tools.build:gradle:8.9.0 after updating Java, Gradle, and Flutter

I’m working on an Flutter project, and I recently updated Java, Gradle, and Flutter to the latest versions. After the update, I started getting the following errors when trying to build my project:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not find com.android.tools.build:gradle:8.9.0.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/8.9.0/gradle-8.9.0.pom
- https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/8.9.0/gradle-8.9.0.pom
Required by:
project :
> Could not find org.codehaus.groovy:groovy-all:latest_version.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/org/codehaus/groovy/groovy-all/latest_version/groovy-all-latest_version.pom
- https://repo.maven.apache.org/maven2/org/codehaus/groovy/groovy-all/latest_version/groovy-all-latest_version.pom
Required by:
project :
</code>
<code>FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring root project 'android'. > Could not resolve all artifacts for configuration ':classpath'. > Could not find com.android.tools.build:gradle:8.9.0. Searched in the following locations: - https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/8.9.0/gradle-8.9.0.pom - https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/8.9.0/gradle-8.9.0.pom Required by: project : > Could not find org.codehaus.groovy:groovy-all:latest_version. Searched in the following locations: - https://dl.google.com/dl/android/maven2/org/codehaus/groovy/groovy-all/latest_version/groovy-all-latest_version.pom - https://repo.maven.apache.org/maven2/org/codehaus/groovy/groovy-all/latest_version/groovy-all-latest_version.pom Required by: project : </code>
FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not find com.android.tools.build:gradle:8.9.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/8.9.0/gradle-8.9.0.pom
       - https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/8.9.0/gradle-8.9.0.pom
     Required by:
         project :
   > Could not find org.codehaus.groovy:groovy-all:latest_version.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/org/codehaus/groovy/groovy-all/latest_version/groovy-all-latest_version.pom
       - https://repo.maven.apache.org/maven2/org/codehaus/groovy/groovy-all/latest_version/groovy-all-latest_version.pom
     Required by:
         project :

Here are the details of my project configuration:

android/build.gradle:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>buildscript {
ext.kotlin_version = '1.8.22'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.9.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.15'
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = "../build"
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(":app")
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
</code>
<code>buildscript { ext.kotlin_version = '1.8.22' repositories { google() mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:8.9.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.google.gms:google-services:4.3.15' } } allprojects { repositories { google() mavenCentral() } } rootProject.buildDir = "../build" subprojects { project.buildDir = "${rootProject.buildDir}/${project.name}" } subprojects { project.evaluationDependsOn(":app") } tasks.register("clean", Delete) { delete rootProject.buildDir } </code>
buildscript {
    ext.kotlin_version = '1.8.22'
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:8.9.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:4.3.15'
    }
}

allprojects {
    repositories {
        google()
        mavenCentral()
    }
}

rootProject.buildDir = "../build"
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(":app")
}

tasks.register("clean", Delete) {
    delete rootProject.buildDir
}

android/app/build.gradle:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>plugins {
id "com.android.application"
id 'com.google.gms.google-services'
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}
android {
namespace 'com.example.chat'
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
defaultConfig {
applicationId = "com.example.chat"
minSdkVersion 23
targetSdkVersion 33
versionCode = flutterVersionCode.toInteger()
versionName = flutterVersionName
}
buildTypes {
release {
signingConfig = signingConfigs.debug
}
}
configurations.all {
resolutionStrategy {
force 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.22'
}
}
}
</code>
<code>plugins { id "com.android.application" id 'com.google.gms.google-services' id "kotlin-android" id "dev.flutter.flutter-gradle-plugin" } android { namespace 'com.example.chat' compileSdk = flutter.compileSdkVersion ndkVersion = flutter.ndkVersion compileOptions { sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 } defaultConfig { applicationId = "com.example.chat" minSdkVersion 23 targetSdkVersion 33 versionCode = flutterVersionCode.toInteger() versionName = flutterVersionName } buildTypes { release { signingConfig = signingConfigs.debug } } configurations.all { resolutionStrategy { force 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.22' } } } </code>
plugins {
    id "com.android.application"
    id 'com.google.gms.google-services'
    id "kotlin-android"
    id "dev.flutter.flutter-gradle-plugin"
}

android {
    namespace 'com.example.chat'
    compileSdk = flutter.compileSdkVersion
    ndkVersion = flutter.ndkVersion
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }
    defaultConfig {
        applicationId = "com.example.chat"
        minSdkVersion 23 
        targetSdkVersion 33
        versionCode = flutterVersionCode.toInteger()
        versionName = flutterVersionName
    }
    buildTypes {
        release {
            signingConfig = signingConfigs.debug
        }
    }
    configurations.all {
        resolutionStrategy {
            force 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.22'
        }
    }
}

wrapper/gradle-wrapper.properties:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
</code>
<code>distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists distributionUrl=https://services.gradle.org/distributions/gradle-8.9-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists </code>
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

Environment details:

  • Java version: 22.0.2 (build 22.0.2+9-70)
  • Gradle version: 8.9
  • Flutter version: Latest

I’ve checked the Maven repositories, but I still get the “Could not resolve” errors for com.android.tools.build:gradle:8.9.0 and org.codehaus.groovy:groovy-all:latest_version.

What could be causing this issue, and how can I resolve it?

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật