Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not find com.android.tools.build:gradle:3.5

Tags:

I'm trying to update gradle from 1.3.1 to 3.5, as some of my dependencies requires version 3.3 or above.

I've seen similar questions, but none of them help.

build.gradle:

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

gradle-wrapper.properties:

distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-all.zip 

Still i'm getting this when trying to do anything (build, clean etc):

Building and installing the app on the device (cd android && ./gradlew installDebug...  FAILURE: Build failed with an exception.  * What went wrong: A problem occurred configuring root project 'chat'. > Could not resolve all dependencies for configuration ':classpath'.    > Could not find com.android.tools.build:gradle:3.5.      Searched in the following locations:          https://jcenter.bintray.com/com/android/tools/build/gradle/3.5/gradle-3.5.pom          https://jcenter.bintray.com/com/android/tools/build/gradle/3.5/gradle-3.5.jar      Required by:          project :  * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.  BUILD FAILED 
like image 923
stkvtflw Avatar asked Apr 19 '17 13:04

stkvtflw


People also ask

Could not resolve com Android tools build gradle 3.5 0 flutter?

This kind of issue usually appears either due to a gradle misconfig or in your case, it looks more of an internet issue. Try running flutter clean in your project source and then using flutter build appbundle and check whether you're able to run the command without any errors.

Where is gradle folder in Android?

It is located in the root project directory and its main function is to define the build configurations that will be applied to all the modules in the project.

What is gradle plugin?

The Android Gradle plugin (AGP) is the official build system for Android applications. It includes support for compiling many different types of sources and linking them together into an application that you can run on a physical Android device or an emulator.


1 Answers

To fix this issue check do you have google() repo in your project's level build.gradle file.

buildscript {     repositories {         jcenter()         google() //HAVE YOU MISS IT?     }     dependencies {         classpath 'com.android.tools.build:gradle:3.5.0'     } }  allprojects {     repositories {         jcenter()         google() //HAVE YOU MISS IT?     } } 
like image 197
Yuliia Ashomok Avatar answered Oct 18 '22 18:10

Yuliia Ashomok