Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Update the gradle to 3.4.1in android studio

I have tried many thing that is mentioned on the internet but still i am unable to resolve the issue ,while sync it's showing me following error

Error:Could not find com.android.tools.build:gradle:3.4.1.
Searched in the following locations:
    file:/Applications/Android Studio.app/Contents/gradle/m2repository/com/android/tools/build/gradle/3.4.1/gradle-3.4.1.pom
    file:/Applications/Android Studio.app/Contents/gradle/m2repository/com/android/tools/build/gradle/3.4.1/gradle-3.4.1.jar
    https://jcenter.bintray.com/com/android/tools/build/gradle/3.4.1/gradle-3.4.1.pom
    https://jcenter.bintray.com/com/android/tools/build/gradle/3.4.1/gradle-3.4.1.jar
Required by:
    project :

I have changed the gradle-wrapper.properties in gradle of my projectlike this and sync the project

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip
like image 624
Barnali Bhattacharjee Avatar asked Mar 09 '17 17:03

Barnali Bhattacharjee


2 Answers

First of all you should add the dependency in Project's build.gradle:

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

And check all repositories groups that they contain google() repository:

repositories {
    jcenter()
    google()
}

After that in gradle-wrapper.properties you should change the distributionUrl:

https\://services.gradle.org/distributions/gradle-5.1.1-all.zip

like image 63
Leo240 Avatar answered Oct 29 '22 07:10

Leo240


Downgrade your version com.android.tools.build:gradle:3.4.1. is not found in https://jcenter.bintray.com/com/android/tools/build/gradle/ repository.

Include the below classpath in your respective module.

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

Or Download the latest gradle through the below link

https://gradle.org/releases

and include the directory in your project setting.

like image 20
sivaprakash Avatar answered Oct 29 '22 07:10

sivaprakash