user23335140
user23335140

Reputation: 11

A problem occurred configuring root project 'android' error

FAILURE: Build failed with an exception.

Could not resolve all files for configuration ':classpath'. Could not find com.android.tools.build:gradle:7.3.3. Searched in the following locations: - https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/7.3.3/gradle-7.3.3.pom - https://jcenter.bintray.com/com/android/tools/build/gradle/7.3.3/gradle-7.3.3.pom Required by: project :

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

BUILD FAILED in 5s Exception: Gradle task assembleDebug failed with exit code 1

gradle-wrapper.properties

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https://services.gradle.org/distributions/gradle-7.3.3-all.zip

build.gradle

dependencies {
        classpath 'com.android.tools.build:gradle:7.3.3'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }

i found the gradle version this project uses

Upvotes: 1

Views: 198

Answers (1)

Robin
Robin

Reputation: 961

In your build.gradle the version does not exist.

dependencies {
    classpath 'com.android.tools.build:gradle:7.3.3' <-- does not exist.
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}

If we check the following link we can see the highest version for your gradle-wrapper.properties should be 7.2.2.

So change your build.gradle to the following:

dependencies {
    classpath 'com.android.tools.build:gradle:7.2.2' <-- change this.
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}

Upvotes: 1

Related Questions