首页 > 解决方案 > 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 错误

标签: androidandroid-studiogradleandroid-gradle-pluginconnection-timeout

解决方案


解决方案:这对我有用

设置 - 语言和框架 - kotline - 更新 kotline 插件版本 - 重新启动计算机 - 运行 android studio 并 shhuk 它工作正常,运行更胖 更新 kotline 插件版本

尝试 1) 使用本地 gradle 存储库

2)在设置-http中更改无代理

3)2天后卸载,重新安装,格式化我的笔记本电脑:

我试图在设置中看到一个 kotline。然后是 kotline 的更新,


推荐阅读