连接超时错误gradle这个同步,在Android Studio中3.3样品的Hello World应用程序。此前据无代理在机器人工作室设置HTTP设置中设置工作。我试图从堆栈溢出其他的解决办法。貌似gradle这个不能从所有URL下载。现在经过彻底卸载它重新安装工作室。重装后问题仍然存在更新。
。有时打造清洁从GUI并未在所有的事情。
项目一级的build.gradle文件**顶级构建文件,你可以添加常用的配置选项,所有子项目/模块。
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
**
应用级的build.gradle文件
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.myapplication"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
更新
格式化我的Windows 10和新安装的开发工具后,现在抛出摇篮同步失败:读超时错误
它的网络问题无法建立offline
通Gradle
说法
尝试./gradlew tasks --offline
对于offline
模式访问摇篮CLI文档运行Android项目:Gradle
Android的工作室
在Android中,工作室可以让Gradle
建立自己的项目offline
模式可供选择:
Settings
- Build, Execution, Deployment
- Build tools
- Gradle