gpt4 book ai didi

android - gradle 同步失败,在 android studio 3.3.1 中读取示例 hello world 应用程序的超时错误

转载 作者:行者123 更新时间:2023-12-03 06:33:13 25 4
gpt4 key购买 nike

gradle 同步中的连接超时错误,在 android studio 3.3 中用于示例 hello world 应用程序。
早些时候,它在 android studio 设置中的 http 设置中没有设置代理。
我已经尝试过堆栈溢出的其他解决方案。看起来 gradle 无法从所有网址下载。
现在完全卸载后重新安装工作室。
更新
重新安装后问题依旧。
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 和新安装的开发工具后,它现在抛出 Gradle Sync Failed: Read timeout error

最佳答案

其网络问题无法建立通行证 offline Gradle 中的参数

试试 ./gradlew tasks --offline
offline 中运行 Android 项目方式访问梯度 CLI 文档:Gradle

安卓工作室

在Android中,studio可以制作Gradleoffline 中构建您的项目模式选项:
Settings -- Build, Execution, Deployment -- Build tools -- Gradle
Gradle Offline Android

关于android - gradle 同步失败,在 android studio 3.3.1 中读取示例 hello world 应用程序的超时错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54531478/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com