0

I followed every step to setup new GRADLE version.

I already had v2.1 and to update, I downloaded v4.1

Then, I unpacked it into a directory and move all data into the following directory:

C:\Program Files\Android\Android Studio1\gradle\gradle-4.1

In File->Settings->Build->Gradle tab I put that path as the value for Use local gradle distribution

Then added extra environment variable GRADLE_HOME with the value = same folder name.

Also, I've added the dir to the variable path

.... Now when I run Android Studio, it says:

Error:A problem occurred configuring root project 'Empty'.

Could not resolve all dependencies for configuration ':classpath'. Could not find com.android.tools.build:gradle:4.1. Searched in the following locations: file:/C:/Program Files/Android/Android Studio1/gradle/m2repository/com/android/tools/build/gradle/4.1/gradle-4.1.pom file:/C:/Program Files/Android/Android Studio1/gradle/m2repository/com/android/tools/build/gradle/4.1/gradle-4.1.jar https://jcenter.bintray.com/com/android/tools/build/gradle/4.1/gradle-4.1.pom https://jcenter.bintray.com/com/android/tools/build/gradle/4.1/gradle-4.1.jar Required by: enter code here project :

Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841

1 Answers1

0

Could not resolve all dependencies for configuration ':classpath'. Could not find com.android.tools.build:gradle:4.1

Gradle and the Gradle plugin for Android are not the same.

You are using (it is the gradle plugin for Android)

classpath 'com.android.tools.build:gradle:4.1'

and this version doesn't exist.

The latest beta version is:

classpath 'com.android.tools.build:gradle:3.0.0-beta4'

Here more details about the new 3.0 gradle plugin.

The latest stable version is:

classpath 'com.android.tools.build:gradle:2.3.3'

Here more details about the gradle plugin.

Instead if you want to change the gradle version just update the URL in gradle-wrapper.properties

For example:

distributionUrl=\
  https\://services.gradle.org/distributions/gradle-4.1-rc-1-all.zip

or use a local distribution as in your case.

Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841
  • no man, that's not about that. Initially I got message after I updated last version of AS - 2.3.3. the message is described here: https://stackoverflow.com/questions/43077386/gradle-error-minimum-supported-gradle-version-is-3-3-current-version-is-3-2 –  Sep 08 '17 at 17:32
  • then I followed the answer and downloaded the last version v4.1 Aug 07, 2017. and then I got another problem with setting up that new gradle. –  Sep 08 '17 at 17:34
  • @VitaliPetrov the error described in answer depends by the wrong plugin. This is some separate problem. It has nothing to do with your question. There is something wrong with your build.gradle file. You may wish to consider asking a separate question – Gabriele Mariotti Sep 08 '17 at 20:27
  • I agreed.. you're right.. sorry, I'm competely exhasted. –  Sep 08 '17 at 21:58
  • :) the problem that I even don't know what should I ask.. I don't understand why it happens and I've seen the same question with the answer.. but that answer didn't work for me. I'm not sure if I can duplicate the same question// –  Sep 08 '17 at 22:01
  • maybe better if I'll make a video. –  Sep 08 '17 at 22:02