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
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With