Could Not Find Com. Android. Tools. Build: Gradle:7.0.3

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:

  • Required by: project : Add google Maven repository and sync project Open File "
9

2 Answers

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

buildscript {
  repositories {
    mavenCentral()
    maven {
      url '
      name 'Google'
    }
  }

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

allprojects {
  repositories {
    mavenCentral()
    maven {
      url '
      name 'Google'
    }
  }

  ...
}
1

Just Add mavenCentral() to build.gradle

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Elena Rostova

Elena Rostova

Lead Health, Wellness & Medical Journalist

Elena Rostova holds a Master's degree in Public Health Journalism. She covers groundbreaking medical research, holistic wellness trends, mental health awareness, and nutritional science.

Share this article
Twitter Facebook Pinterest