1

[> Could not resolve all artifacts for configuration ':classpath'.

Could not resolve com.android.tools.build:gradle:7.0.0-alpha08. Required by: project : > No cached version of com.android.tools.build:gradle:7.0.0-alpha08 available for offline mode. > No cached version of com.android.tools.build:gradle:7.0.0-alpha08 available for offline mode. Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.30. Required by: project : > No cached version of org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.30 available for offline mode. > No cached version of org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.30 available for offline mode.

Possible solution:

  • Disable offline mode and rerun the build ]1
aikd101
  • 11
  • 2
  • I toggled gradle offline mode to fix this but it didn't work. Also cleared gradle caches yet the it failed to sync – aikd101 Feb 26 '21 at 05:54
  • I did that too but the issue hasn't been fixed yet. – aikd101 Feb 26 '21 at 07:16
  • https://ibb.co/nmyHxFV – Android_id Feb 26 '21 at 07:25
  • @Android_id i got a "Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/7.0.0-alpha08/gradle-7.0.0-alpha08.pom'. Received status code 400 from server: Bad Request Disable Gradle 'offline mode' and sync project" on the console. I also toggle graddle and sync project yet it failed. – aikd101 Feb 26 '21 at 09:14
  • I'm only getting this error whenever i want to use android studio Arctic fox canary8 but the other android studio works fine. – aikd101 Feb 26 '21 at 09:15
  • check this https://stackoverflow.com/a/52611119/11298876 might help u – Android_id Feb 26 '21 at 09:48
  • Thanks a lot... it helped. there was a missing gradle.properties file on android studio.https://stackoverflow.com/questions/37380417/android-studio-where-is-gradle-properties-file.. SOLVED!!!. – aikd101 Feb 26 '21 at 12:18
  • Does this answer your question? [Gradle Sync Failed Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.1.3/gradle-3.1.3.pom'](https://stackoverflow.com/questions/52604185/gradle-sync-failed-could-not-get-https-dl-google-com-dl-android-maven2-com-an) – Vitor Ramos Feb 27 '21 at 14:39

2 Answers2

1

Android Studio Arctic Fox | 2020.3.1 Canary 8 doesn't work internally.

I suggest migrating to Android Studio Arctic Fox (2020.3.1) Canary 7 with the following definitions:

build.gradle (project)

buildscript {
    dependencies {
        classpath "com.android.tools.build:gradle:7.0.0-alpha07"
    }
}

gradle-wrapper.properties

distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.1-bin.zip

Note: Do not use distributionUrl=.../gradle-6.8.2-bin.zip or classpath "...:7.0.0-alpha08" since they are associated with the Canary 8 compilation.


You also have to install Java 11 and configure it in the project

$ sudo apt-get install openjdk-11-jdk

JDK Location: /usr/lib/jvm/java-1.11.0-openjdk-amd64

build.gradle (:app)

android {
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_11
        targetCompatibility JavaVersion.VERSION_11
    }
    kotlinOptions {
        jvmTarget = JavaVersion.VERSION_11.toString()
        useIR = true
    }
}

Good Luck

Install Java 11

Braian Coronel
  • 22,105
  • 4
  • 57
  • 62
0

I got this same error resolved by disabling controlled folder access in the Windows 10 defender firewall. Navigate to ***settings>update &security>windows security>virus & Threat protection>Ransomware protection>manage ransomware protection>***toggle the controlled folder access to be in grey so that the Gradle daemon can be allowed to make changes to the \usename.graddle\daemon\graddleversion folder

Moses Asiago
  • 89
  • 1
  • 11