Gradle Connection超时 [英] Gradle Connection timed out
问题描述
$ b
错误:无法解析所有配置文件':app:debugCompileClasspath'。
无法解析com.android.support:appcompat-v7:26.1.0。
必需的:
project:app
无法解析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。
无法获取资源' https://jcenter.bintray.com/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.pom '。
无法HEAD' https://jcenter.bintray.com/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.pom '。
连接到jcenter.bintray.com:443 [jcenter.bintray.com/108.168.243.150]失败:连接超时:connect
gradle包装器属性
#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
我的gradle(模块应用程序)
<$应用插件:'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationIdcurlpagetutorial。 example.com.mydd
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName1.0
testInstrumentationRunnerandroid.support.test.runner.AndroidJUnitRunner
}
buildTypes {
releas e {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
}
}
}
依赖项{
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
//顶级构建文件,您可以在其中添加常见配置选项到所有子项目/模块。
buildscript {
存储库{
google()
jcenter()
}
依赖关系{
classpath 'com.android.tools.build:gradle:3.0.0'
//注意:不要在这里放置应用程序依赖关系;它们属于单个模块build.gradle文件中的
//
}
}
allprojects {
repositories {
google()
jcenter()
}
}
任务清理(类型:删除){
删除rootProject.buildDir
}
新错误
必需条件:
project: app
无法解析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。
我在这里待了很长时间请帮助我
从以下网址下载gradle: http ://services.gradle.org/distributions/
选择文件,例如gradle-4.1-rc-1-all.zip
在AndroidStudio中找到您的gradle目录
setting - > Build,Execut解压文件到(你的gradle路径)\ wrapper \dists\gradle-4.1-all\bzyivzo6n839fup2jbap0tjew
after updating android studio 2.3 to 3.0 i got lots of errors so many work i done it but didn't work
Error:Could not resolve all files for configuration ':app:debugCompileClasspath'.
Could not resolve com.android.support:appcompat-v7:26.1.0. Required by: project :app Could not resolve com.android.support:appcompat-v7:26.1.0. Could not parse POM https://dl.google.com/dl/android/maven2/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.pom Already seen doctype. Could not resolve com.android.support:appcompat-v7:26.1.0. Could not get resource 'https://jcenter.bintray.com/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.pom'. Could not HEAD 'https://jcenter.bintray.com/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.pom'. Connect to jcenter.bintray.com:443 [jcenter.bintray.com/108.168.243.150] failed: Connection timed out: connect
gradle wrapper 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 (module app)
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
}
New errors
Required by: project :app
Could not resolve com.android.support:appcompat-v7:26.1.0. Could not parse POM https://dl.google.com/dl/android/maven2/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.pom Already seen doctype.
Could not resolve com.android.support:appcompat-v7:26.1.0.
Could not resolve com.android.support.test:runner:1.0.1.
Could not resolve com.android.support.test.espresso:espresso-core:3.0.1.
I'm stuck here for long time please help me
Download gradle from:http://services.gradle.org/distributions/
choose the file such as gradle-4.1-rc-1-all.zip
Find your gradle directory in AndroidStudio setting-->Build,Execution,Deployment -->Gradle
Unzip the file to "(your gradle path)\wrapper\dists\gradle-4.1-all\bzyivzo6n839fup2jbap0tjew"
这篇关于Gradle Connection超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!