After installing Android studio and creating a new project, I get the following message:
and in the "Build: Sync" section I get the following error:
After clicking in "Try Again" nothing changes. How can I fix it?
You need to add the google() repo in the top level gradle file, also it should be before jcenter():
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
Check gradle is on offline or online mode:
File -> Settings->Build,Execution,Deployment->Gradle->uncheck Offline work->Click the OK button->Rebuild the Project
Try to check your proxy. make sure you have access to jcenter URL. It happens to me when trying to make a new project or add dependencies in my office because of proxy restriction. To check proxy, open:
File > Settings > Appearance & Behavior > System Setting > HTTP Proxy
You can use auto-detect proxy or manual proxy if you have proxy on your network. Hope it help.