Could not find com.android.tools.build:gradle:7.0.3

Viewed 8246

I have a project and I have the apk, but I have changed a value in the calculate.java file and I want to rebuild the project. But the following error appears. What should I do? I am not an android studio developer and I am only a novice. " Could not find com.android.tools.build:gradle:7.0.3. Searched in the following locations:

2 Answers

Make sure that your build.gradle file contains Google's Maven repository:

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

  dependencies {
    classpath 'com.android.tools.build:gradle:7.0.3'
  }
}

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

  ...
}

Just Add mavenCentral() to build.gradle

Related