android studio connection reset error
Solution 1
the problem is not with gradle
. the problem is that gradle
cannot connect to the bintray servers
. bintray
has blocked some countries from accessing their servers .and because of that gradle
cannot retrieve libraries
it needs to build the project and run the application. so what do we do?
changing the IP address will do the trick.
now a word of advice to those who are new to android programming or programming in general. do not waste your time on free VPN servers or proxies which has a lot of issues like connection failure, low speed and etc . just buy a premium account from a good service and use that. it'll worth it.
like this one:
another advice is sometimes using protocols like Stunnel and cisco might still cause problems like connection timeout errors
but vpn and kerio will always work ok
Solution 2
Open timepicker-library's gradle file and remove below code from it and try to sync project again.
apply plugin: 'bintray-release'
dependencies {
classpath 'com.novoda:bintray-release:0.3.4'
}
publish {
userOrg = 'erz05'
groupId = 'com.github.erz05'
artifactId = 'TimePicker'
version = '0.1.5'
description = 'Android Library for TimePicker View'
website = 'https://github.com/erz05/TimePicker'
}
Hope this will help you.
Solution 3
try to do this add mavenCentral()
to gradle
:
buildscript {
repositories {
jcenter()
mavenCentral() // This repo should have the gradle plugin
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
also check if you are working offline and uncheck it
Solution 4
i solve this problem in this way. be careful it causes with different problems like using proxy, dns connection windows , fire wall block , ....
but i use proxy in file/settings/proxy in android studio and after that i set no proxy. after that whenever use kerio vpn or cisco didnt work.
solution :go to gradle.propertices and remove every proxy script from there and sync gradle and work fine
Solution 5
In my case, my antivirus software was blocking it, disabling antivirus worked for me.
alireza easazade
I'm a Mobile Developer. Flutter and Android native is my thing. I absolutely LOVE Flutter. I love making apps and thinking about GUI app architectures or anything that makes development and maintenance process sweeter. contact me on whatsapp email me at [email protected] or follow me on github
Updated on July 09, 2022Comments
-
alireza easazade almost 2 years
I've downloaded a sample project (TimePicker-master) weeks ago from GitHub and since then when ever I try to sync that project i get this error. Gradle 'TimePicker-master'project refresh failed Error: Connection reset
i have tried different proxies but it did not work. because i don't know what the problem even is? and i didn't found the reason searching online now i get the same problem when i try to download intelliJ plugins while I'm using proxies. what is the problem and how do i solve it ?(be friendly and helpful to beginners)
-
Koorosh Ghorbani about 7 yearsTry Kerio or Cisco for sure , Connection Reset is only related to our restrictions on our country , some times government blocks gradle ip some times gradle blocks iranian ip's and there is another possibility maybe your project using a repository which is DOWN for now .
-
alireza easazade about 7 yearsi'm trying kerio. is this dependency an issue ? classpath 'com.novoda:bintray-release:0.3.4'
-
Koorosh Ghorbani about 7 yearsCheck your gradle repos and use a VPN not proxy because most times proxies wont work as well as VPNs
-
alireza easazade about 7 yearsjust did that and same problem
-
Koorosh Ghorbani about 7 yearsOpen Your Main Build.gradle not the Module Gradle file and check the repositories section :D
-
alireza easazade about 7 yearsjcenter() is all
-
Koorosh Ghorbani about 7 yearsare you sure that you have deleted all proxy settings from gradle local file ?
-
-
alireza easazade about 7 yearsi did it again and changed the gradle version in my dependencies from to 2.2.2 to 2.3.0 and it solved the problem does anyone know why?
-
alireza easazade over 5 yearsdadash ye vpn khoob vasl kon hame chi hale. kerio va stunnel , baghie protocol ha ham ziad khoob nistan . faghat vpn man az vpnsaz mikharam soraatesh daghighan hamoon sorat internet khodame . ghati ham nadare.
-
Reza over 3 yearsalireza easazade soltan laanat be in tahrima o filtera. doodesh faghat too cheshme ma mardom mire. :D
-
reddtoric about 2 yearsAlso, for me, I was using Kaspersky and "pausing protection" did not work. I had to completely exit Kaspersky in order for Android Studio to connect to the internet? Finally, I was able to install not installed SDK platforms and tools.