Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I updated the Android Studio to the latest version (3.6.1) and Gradle Plugin is not found now

Tags:

android

In an Android application,
I updated the Android Studio to the latest version (3.6.1)

Now when Syncing Gradle, the Gradle Plugin is not found with the errors as following:

Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':classpath'.

And

Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find com.android.tools.build:gradle:3.0.0.

It's driving me crazy cause I change the Gradle Version and Gradle Plugin Version to several other possibilities but again the Gradle Plugin is not found with the same error

Build.Gradle file:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0'
    }
}

allprojects {
    repositories {
        jcenter()
        google()
        maven { url "https://jitpack.io" }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

And Gradle.Wrappers.Properties file:

#Thu Mar 05 15:41:52 IRST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip

Edit :
I added the following data too:

Compile Sdk version: 25
Build Tools Version: 25.0.3

like image 253
AndroidPlayer2 Avatar asked Mar 05 '20 12:03

AndroidPlayer2


People also ask

Where is Android Gradle plugin located?

You can specify the Gradle version in either the File > Project Structure > Project menu in Android Studio, or update your Gradle version using the command line.

Where can I find Gradle in Android Studio?

gradle file, located in the root project directory, defines dependencies that apply to all modules in your project. By default, the top-level build file uses the plugins block to define the Gradle dependencies that are common to all modules in the project.

How do I find Gradle plugin version?

In Android Studio, go to File > Project Structure. Then select the "project" tab on the left. Your Gradle version will be displayed here.


1 Answers

In your gradle-wrapper.properties file, change the distributionUrl to:

https://services.gradle.org/distributions/gradle-5.6.4-all.zip

The gradle-wrapper.properties file content should be like this:

#Wed Mar 11 00:28:24 EET 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
like image 114
YKassouf Avatar answered Sep 22 '22 07:09

YKassouf