title: Could not resolve all artifacts for configuration ':classpath'. > Could not resolve com.android.tools.build:gradle:4.1.0
body: <p>This error came up out of nowhere, until then everything worked fine for months.</p>
  <p>Now even creating a new project results the same error without any modification.</p>
  <p>flutter run -&gt;</p>
  <pre><code>Using hardware rendering with device sdk gphone x86 arm. If you notice graphics artifacts, consider enabling software
  rendering with &quot;--enable-software-rendering&quot;.
  Launching lib/main.dart on sdk gphone x86 arm in debug mode...
                                                                          
  FAILURE: Build failed with an exception.                                
                                                                          
  * What went wrong:                                                      
  A problem occurred configuring root project 'android'.                  
  &gt; Could not resolve all artifacts for configuration ':classpath'.       
     &gt; Could not resolve com.android.tools.build:gradle:4.1.0.            
       Required by:                                                       
           project :                                                      
        &gt; Could not resolve com.android.tools.build:gradle:4.1.0.         
           &gt; Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.1.0/gradle-4.1.0.pom'.
              &gt; Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.1.0/gradle-4.1.0.pom'.
                 &gt; sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
                                                                          
  * Try:                                                                  
  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.
                                                                          
  * Get more help at https://help.gradle.org                              
                                                                          
  BUILD FAILED in 2s                                                      
  Running Gradle task 'assembleDebug'...                                  
  Running Gradle task 'assembleDebug'... Done                         4.8s
  Exception: Gradle task assembleDebug failed with exit code 1
  </code></pre>
  <p>app level build.gradle -&gt;</p>
  <pre><code>    def localProperties = new Properties()
  def localPropertiesFile = rootProject.file('local.properties')
  if (localPropertiesFile.exists()) {
      localPropertiesFile.withReader('UTF-8') { reader -&gt;
          localProperties.load(reader)
      }
  }
  
  def flutterRoot = localProperties.getProperty('flutter.sdk')
  if (flutterRoot == null) {
      throw new GradleException(&quot;Flutter SDK not found. Define location with flutter.sdk in the local.properties file.&quot;)
  }
  
  def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
  if (flutterVersionCode == null) {
      flutterVersionCode = '1'
  }
  
  def flutterVersionName = localProperties.getProperty('flutter.versionName')
  if (flutterVersionName == null) {
      flutterVersionName = '1.0'
  }
  
  apply plugin: 'com.android.application'
  apply plugin: 'kotlin-android'
  apply from: &quot;$flutterRoot/packages/flutter_tools/gradle/flutter.gradle&quot;
  
  android {
      compileSdkVersion 30
  
      sourceSets {
          main.java.srcDirs += 'src/main/kotlin'
      }
  
      defaultConfig {
          // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
          applicationId &quot;com.example.utilapp&quot;
          minSdkVersion 16
          targetSdkVersion 30
          versionCode flutterVersionCode.toInteger()
          versionName flutterVersionName
      }
  
      buildTypes {
          release {
              // TODO: Add your own signing config for the release build.
              // Signing with the debug keys for now, so `flutter run --release` works.
              signingConfig signingConfigs.debug
          }
      }
  }
  
  flutter {
      source '../..'
  }
  
  dependencies {
      implementation &quot;org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version&quot;
  }
  </code></pre>
  <p>project level build.gradle -&gt;</p>
  <pre><code>buildscript {
      ext.kotlin_version = '1.3.50'
      repositories {
          google()
          jcenter()
      }
  
      dependencies {
          classpath 'com.android.tools.build:gradle:4.1.0'
          classpath &quot;org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version&quot;
      }
  }
  
  allprojects {
      repositories {
          google()
          jcenter()
      }
  }
  
  rootProject.buildDir = '../build'
  subprojects {
      project.buildDir = &quot;${rootProject.buildDir}/${project.name}&quot;
  }
  subprojects {
      project.evaluationDependsOn(':app')
  }
  
  task clean(type: Delete) {
      delete rootProject.buildDir
  }
  </code></pre>
  <p>flutter doctor -&gt;</p>
  <pre><code>Doctor summary (to see all details, run flutter doctor -v):
  [✓] Flutter (Channel stable, 2.0.1, on macOS 11.1 20C69 darwin-x64, locale en-GB)
  [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
  [!] Xcode - develop for iOS and macOS
      ! CocoaPods 1.7.5 out of date (1.10.0 is recommended).
          CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on
          the Dart side.
          Without CocoaPods, plugins will not work on iOS or macOS.
          For more info, see https://flutter.dev/platform-plugins
        To upgrade see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
  [✓] Chrome - develop for the web
  [✓] Android Studio (version 4.1)
  [✓] VS Code (version 1.54.1)
  [✓] Connected device (2 available)
  
  ! Doctor found issues in 1 category.
  </code></pre>