Gradle Connection Timeout

after updating Android 2.3 studio to 3.0 I had a lot of errors, so much work I did, but did not work

Error: Failed to resolve all files for configuration ': app: debugCompileClasspath'.

Failed to resolve com.android.support:appcompat-v7:26.1.0. Requires: project: application Failed to resolve com.android.support:appcompat-v7:26.1.0. Failed to parse POM https://dl.google.com/dl/android/maven2/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.pom I already saw doctype. Failed to resolve com.android.support:appcompat-v7:26.1.0. Failed to get the resource https://jcenter.bintray.com/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.pom '. The HEAD failed ' https://jcenter.bintray.com/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.pom '. Connect to jcenter.bintray.com-00-0043 [jcenter.bintray.com/108.168.243.150] failed: connection timeout: connect

gradle shell properties

#Mon Nov 06 17:20:27 IRST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip 

my gradle ( )

 apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "curlpagetutorial.example.com.mydd"
        minSdkVersion 19
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}

gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

:   :

com.android.support:appcompat-v7:26.1.0. POM https://dl.google.com/dl/android/maven2/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.pom doctype.

com.android.support:appcompat-v7:26.1.0.

com.android.support.test: runner: 1.0.1.

com.android.support.test.espresso: espresso-core: 3.0.1.

, ,

+4
2

gradle : http://services.gradle.org/distributions/

, gradle -4.1-rc-1-all.zip

gradle AndroidStudio    → , , → Gradle

"( gradle)\wrapper\dists\gradle -4.1-all\bzyivzo6n839fup2jbap0tjew"

+1

. , , gradle. File->Settings->Build,Execution and deployments->Gradle Check -> Use local gradle distribution gradle .

, gradle -, gradle.properties "/Users/user/.gradle":

#http proxy setup
systemProp.http.proxyHost=url
systemProp.http.proxyPort=port
systemProp.http.nonProxyHosts=*.nonproxyrepos.com|localhost

#https proxy setup
systemProp.https.proxyHost=url
systemProp.https.proxyPort=port
systemProp.https.nonProxyHosts=*.nonproxyrepos.com|localhost

!

0

Source: https://habr.com/ru/post/1688812/


All Articles