[英]Read timed out Error builder.jar (com.android.tools.build:builder:3.2.1) - Flutter - Android Studio
I am just trying to run my first flutter app.我只是想运行我的第一个 flutter 应用程序。
I have already tried Invalidating Cache.我已经尝试过使缓存失效。 Although my internet is slow, manually I have already downloaded the dependencies in less than a minute.
虽然我的互联网很慢,但我已经在不到一分钟的时间内手动下载了依赖项。 But I am unable to install the dependencies manually.
但我无法手动安装依赖项。
Launching lib\main.dart on XT1080 in debug mode...
Initializing gradle...
Resolving dependencies...
* Error running Gradle:
ProcessException: Process "C:\Users\Abuzar\AndroidStudioProjects\flutter_app3\android\gradlew.bat" exited abnormally:
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not download builder.jar (com.android.tools.build:builder:3.2.1)
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/builder/3.2.1/builder-3.2.1.jar'.
> Read timed out
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 18m 48s
Command: C:\Users\Abuzar\AndroidStudioProjects\flutter_app3\android\gradlew.bat app:properties
Finished with error: Please review your Gradle project setup in the android/ folder.
My build.gradle我的 build.gradle
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Can I add this builder-3.2.1 dependency manually or any other fix for this problem?我可以手动添加此 builder-3.2.1 依赖项或针对此问题进行任何其他修复吗? If yes then how?
如果是,那么如何?
I had the same issue.. i fix it by upgrading gradle.. with these steps:我遇到了同样的问题..我通过升级gradle来修复它..使用以下步骤:
open gradle-wrapper.propitiates (if you can't find it open gradle > local propitiates Then click on Open for editing in android studio you will find gradle-wrapper.propitiates there.打开gradle-wrapper.propitiates (如果找不到,请打开gradle > local propitiates然后在 android studio 中单击打开进行编辑,您会在那里找到gradle-wrapper.propitiates 。
Change distributionUrl=https://services.gradle.org/distributions/ gradle-4.10.8-all.zip to distributionUrl=https://services.gradle.org/distributions/ gradle-XXX-all.zip according to the latest gradle version.根据最新//services.gradle.org/distributions/ gradle-XXX-all.zip:更改distributionUrl = HTTPS://services.gradle.org/distributions/ gradle-4.10.8-all.zip到distributionUrl = HTTPS梯度版本。
then open File > project structure > project > android gradle plugin version (change it to XXX) according to the latest combatable gradle plugin version .然后根据最新的可战斗gradle插件版本打开文件>项目结构>项目>android gradle插件版本(将其更改为XXX) 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.