Flutter: Execution failed for task ':app:checkDebugAarMetadata'. Could not resolve all files for configuration ':app:debugRuntimeClasspath'

I faced this issue yesterday. and after 3 hours. I found a way . close Android Studio and
remove C:\Users\<USER>\.gradle folder (or Rename it)

and Re Build Project with a Good VPN

I prefer VPN with Cisco Any connect Protocol .


this is my build.gradle and I add some repository may be it can help you.

buildscript {
    repositories {
//        google()
//        mavenCentral()
        mavenCentral()
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:7.0.0'
        classpath 'com.google.gms:google-services:4.3.10'
    }
}

allprojects {
    repositories {
//        google()
//        mavenCentral()
        mavenCentral()
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    }
}

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

task clean(type: Delete) {
    delete rootProject.buildDir
}