android - gradle 同步失败,在 android studio 3.3.1 中读取示例 hello world 应用程序的超时错误
问题描述
gradle 同步中的连接超时错误,在 android studio 3.3 中用于示例 hello world 应用程序。早些时候,它在 android studio 设置中的 http 设置中没有设置代理。我已经尝试过堆栈溢出的其他解决方案。看起来 gradle 无法从所有网址下载。现在完全卸载后重新安装工作室。 重装后更新 问题依旧。
有时从 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 和新安装的开发工具后,它现在抛出 Gradle Sync Failed: Read timeout 错误
解决方案
推荐阅读
- git - git 补丁在 git send-email 时不声明 Content-Transfer-Encoding
- excel - 比较包含有效日期的单元格引用,如果第二个单元格中的日期超过 180 天,则第二个单元格返回无效
- java - 如何将 5 个不同数组列表的相同索引值存储在一个大小为 5 的数组列表中?
- c++ - Eigen 自定义类和函数参数
- javascript - JS Jest Mocking - 预期收到未定义的错误
- flutter - 没有为类 FirebaseAuth 定义 Flutter firebase signInWithPhoneNumber
- java - 为类创建别名
- jquery - 表转 JSON +rowspan 转海量
- scala - 使用数据帧的 Spark 会话化
- angular - 使用 npm 安装 Angular-cli 时出错