gradle这个同步失败,读超时错误在Android Studio中3.3.1样品的Hello World应用程序

问题描述 投票:-2回答:2

连接超时错误gradle这个同步,在Android Studio中3.3样品的Hello World应用程序。此前据无代理在机器人工作室设置HTTP设置中设置工作。我试图从堆栈溢出其他的解决办法。貌似gradle这个不能从所有URL下载。现在经过彻底卸载它重新安装工作室。重装后问题仍然存在更新。 enter image description here

。有时打造清洁从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和新安装的开发工具后,现在抛出摇篮同步失败:读超时错误

android android-studio gradle android-gradle connection-timeout
2个回答
0
投票

它的网络问题无法建立offlineGradle说法

尝试./gradlew tasks --offline

对于offline模式访问摇篮CLI文档运行Android项目:Gradle

Android的工作室

在Android中,工作室可以让Gradle建立自己的项目offline模式可供选择:

Settings - Build, Execution, Deployment - Build tools - Gradle

Gradle Offline Android


0
投票

解决方案:为我工作

设置 - 语言和框架 - kotline - 更新kotline插件版本 - 重启电脑 - 运行Android工作室和shhuk它的工作原理和它跑fater Update kotline plugin version

使用本地存储库的gradle试过1)

2)改变没有代理在设置-HTTP

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

我想看看在设置一个kotline。再有就是对科特林的更新,

© www.soinside.com 2019 - 2024. All rights reserved.