I'm new to Android studio and I'm trying to set up a new project but I face this error message:
Could not find com.android.tools.build:gradle:7.0.4.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/7.0.4/gradle-7.0.4.pom
- https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/7.0.4/gradle-7.0.4.pom
Required by:
project :
Add google Maven repository and sync project
Open File
I searched the Gradle website and found out 7.0.4 which was set on my Android studio by default, does not exist in the official repository.
So I downloaded another version (7.4.1) and changed the version in the build.gradle file but it didn't solve the problem. I downloaded Gradle by using the gradle-wrapper.properties file and it still doesn't work. Then I tried to use the gradle plugin offline by turning on the offline mode and changing the location in file > settings > Build, Execution, Deployment > Build tools > Gradle and it shows me this error message:
A problem occurred configuring root project 'My Application'.
> Could not resolve all files for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:7.4.1.
Required by:
project :
> No cached version of com.android.tools.build:gradle:7.4.1 available for offline mode.
> No cached version of com.android.tools.build:gradle:7.4.1 available for offline mode.
Possible solution:
- Disable offline mode and rerun the build
It seems that com.android.tools.build:gradle:7.4.1 is nowhere...
I checked the version in Project Structure... and it's 7.4.1 exactly what it is supposed to be. My Android version is 2020.3.1.
I'm stuck. How can I fix this? My project doesn't sync and I can't even start...