Reputation: 422
I downloaded my repository through git
on a new computer, cloned everything, but when I ran a Gradle
sync it failed with this error message:
I tried cleaning the project, invalidating caches / restart, redownload the whole repository, delete Gradle
file and get it back from the repository. Nothing helped. Funny thing is, the guys at the office are building without a problem from the same Gradle
file. Any idea what I'm doing wrong here? Btw, I checked all the 20+ threads here on SO with similar titles, but none of them described the same problem I'm having. However, I tried all the fixes suggested there, but that didn't show any results either.
Upvotes: 1
Views: 4984
Reputation: 1
Open File > Project Structure in window select versions as my.
After that sync gradle
resolve for me
Upvotes: 0
Reputation: 1
Open SDK manager and choose the target SDK version then click ok , it will start installing the version directly.enter image description here
Upvotes: 0
Reputation: 31
Add google() in your app build.gradle.
1. buildscript {
repositories {
google()
jcenter()
.....
}
}
2. allprojects {
repositories {
google()
jcenter()
.....
}
}
Then try to build.
Upvotes: 1
Reputation: 422
After wasting a whole day on this I found out the core of the problem.It was a problem with Gradle
. The links for these four dependencies pointed to pages, which returned 404, therefor Android Studio
couldn't get the dependencies and threw this error. My temporary decision is to use a different Gradle
version, in which the links point to the right pages.
Upvotes: 3