5

My current Gradle plugin version is 4.1.2 and this version working correctly but when I update to 4.1.3 I get this error and I can't build the project: Note:I added maven() and jcenter().

A problem occurred configuring root project 'AndroidCryptography'.

Could not resolve all artifacts for configuration ':classpath'. Could not find gradle-4.1.3.jar (com.android.tools.build:gradle:4.1.3). Searched in the following locations: https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.1.3/gradle-4.1.3.jar

my build.gradle:

enter image description here

Saeed Noshadi
  • 829
  • 12
  • 34
  • 1
    I recommend that you edit your question and provide a [mcve]. In this case, that would be your project's top-level `build.gradle` file, most likely. – CommonsWare Mar 25 '21 at 23:29
  • I think my build.gradle file doesn't have a problem – Saeed Noshadi Mar 26 '21 at 08:16
  • In any of your modules' `build.gradle` files (e.g., `app/build.gradle`), do you also have a `buildscript` closure? If so, you might want to check them too. Also, if you click the link in your question to the JAR, does it work? If the answer is no, then there is something about your network that is blocking access to that JAR, as it works from here. – CommonsWare Mar 26 '21 at 11:16
  • Can you make sure you have at least the Gradle wrapper 6.5-all? `https://services.gradle.org/distributions/gradle-6.5-all.zip`. You can also try to run in the terminal: `./gradlew app:build -info` and see which error is returning, might give you proper hints to the solution. – xatok Mar 29 '21 at 20:46

2 Answers2

2

You Have To Go To -->gradle-wrapper.properties and change your gradle version to 6.8.3

for more info you can load the attached image

Firoz Memon
  • 4,282
  • 3
  • 22
  • 32
0

Add the following to the build.gradle(Project) in repositories

google()