alireza easazade
alireza easazade

Reputation: 3822

android studio connection reset error

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

enter image description here

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)

Upvotes: 10

Views: 42346

Answers (6)

alireza easazade
alireza easazade

Reputation: 3822

Update: right now only thing that works at least in IRAN is using v2ray

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:

enter image description here

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

Upvotes: 9

Mamathuba Ndivho
Mamathuba Ndivho

Reputation: 11

This worked for me: enter image description here

File >> Settings >> Build, Execution, Deployment >> Gradle Build >> Android Studio, then tick Enable embedded Maven repositoryenter image description here

Upvotes: 1

Sina Rahbary
Sina Rahbary

Reputation: 41

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

Upvotes: 2

Sushant Yelpale
Sushant Yelpale

Reputation: 889

In my case, my antivirus software was blocking it, disabling antivirus worked for me.

Upvotes: 1

batsheva
batsheva

Reputation: 2295

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

Upvotes: 1

bhaumiksoni
bhaumiksoni

Reputation: 244

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.

Upvotes: 1

Related Questions