I cant seem to get build tools for the latest gradle at all. I suspect its something to do with proxy setting for gradle. I have had a good look online but still cant seem t
late but it worked for me:
change your dns setting by going Network and sharing center.
In left pane choose change adapter setting
-right click on your network connection
-properties
-select ipv4
-properties
- now in dns server setting:-
-choose the option use the following dns server addresses
and use google dns server 8.8.8.8 as preferred dns server and
8.8.4.4 as alternate dns server.
it will solve your problem.
In my case, my Android Studio version was 3.6.1 and i have modified the classpath like below;
classpath 'com.android.tools.build:gradle:3.6.1'
and that error was gone.
I got this issue solved by switching internet from Wifi to mobile hot-spot. It means this issue occurs due to network issue. I could also see below logs which confirms my understanding,
Connect to jcenter.bintray.com:443 [jcenter.bintray.com/75.126.118.188] failed: Connection timed out: connect
and
Connect to repo1.maven.org:443 [repo1.maven.org/151.101.36.209] failed: Connection timed out: connect
Hope it helps.
In my case, I solved it by stopping gradlew process in VS code using the below command
android/gradlew --stop
Tools > SDK Manager > SDK Tools > Show Package Details and remove all the old versions
Find and Replace:
jcenter()
maven {
url "https://maven.google.com"
}
to:
maven {
url "https://maven.google.com"
}
jcenter()