Reputation: 21
ERROR: Could not find com.android.tools.build:gradle:3.5.2.
Searched in the following locations:
-
https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.5.2/gradle-3.5.2.pom -
https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.5.2/gradle-3.5.2.jar - https://jcenter.bintray.com/com/android/tools/build/gradle/3.5.2/gradle-3.5.2.pom - https://jcenter.bintray.com/com/android/tools/build/gradle/3.5.2/gradle-3.5.2.jar Required by: project : Open File
ext {
var = '3.5.2'
var1 = '3.5.2'
}// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
we recived this error from my android studio when run my projects we used online and offline mod but they not worked corectly This error has confused me
The following code is related to wrapper
ext {
var = '3.5.2'
var1 = '3.5.2'
}// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Upvotes: 1
Views: 4854
Reputation: 1809
I also had this problem on Linux (ubuntu)
I tried different ways but the problem still didn't work out.
Finally, I remove /home/(user)/.gradle
directory and restart Android Studio and this error fixed.
Upvotes: 1
Reputation: 2286
Follow these steps:
Project
level build.gradle
file:// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.2'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Build > Clean Project
Build > Rebuild Project
Build > Make Project
File > Invalidate Caches/Restart
Upvotes: 0
Reputation: 23
This problem basically occurs when you are trying to load an old project. The best solution as of my knowledge is to download the links one by one, the project is showing and sync it. Check out the build Gradle files for any outdated dependencies. Check out if you have
google()
repo in your project. Make sure you find this line in your dependencies.
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
}
Upvotes: 1