[英]Could not find com.android.tools:r8:1.5.25
A problem occurred configuring root project 'android'.配置根项目“android”时出现问题。
Could not resolve all artifacts for configuration ':classpath'.
无法解析配置“:classpath”的所有工件。 Could not download r8-1.6.84.jar (com.android.tools:r8:1.6.84) > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/r8/1.6.84/r8-1.6.84.jar'.
无法下载 r8-1.6.84.jar (com.android.tools:r8:1.6.84) > 无法获取资源'https://dl.google.com/dl/android/maven2/com/android/tools /r8/1.6.84/r8-1.6.84.jar'。 > Premature end of Content-Length delimited message body (expected: 4,257,995; received: 2,097,136)
> Content-Length 分隔的消息正文过早结束(预期:4,257,995;收到:2,097,136)
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
google()
jcenter()
maven {
url 'http://storage.googleapis.com/r8-releases/raw'
}
}
dependencies {
classpath 'com.android.tools:r8:1.6.84'
// classpath 'com.android.tools:r8:1.4.57'
classpath 'com.google.gms:google-services:4.3.3'
classpath 'com.android.tools.build:gradle:4.0.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.android.tools.build:gradle:4.0.0'
}
}
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
}
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
project.evaluationDependsOn(':app')
afterEvaluate {project ->
if (project.hasProperty("android") && project.property("android").compileSdkVersion.equals("android-R")) {
android {
compileSdkVersion 30
}
}
}
}
Full Error message here:此处的完整错误消息:
Could not resolve all artifacts for configuration ':classpath'.
无法解析配置“:classpath”的所有工件。 Could not download r8-1.6.84.jar (com.android.tools:r8:1.6.84) > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/r8/1.6.84/r8-1.6.84.jar'.
无法下载 r8-1.6.84.jar (com.android.tools:r8:1.6.84) > 无法获取资源'https://dl.google.com/dl/android/maven2/com/android/tools /r8/1.6.84/r8-1.6.84.jar'。 > Premature end of Content-Length delimited message body (expected: 4,257,995; received: 2,097,136) Could not download bundletool-0.13.2.jar (com.android.tools.build:bundletool:0.13.2) > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/bundletool/0.13.2/bundletool-0.13.2.jar'.
> Content-Length 分隔的消息正文过早结束(预期:4,257,995;收到:2,097,136)无法下载 bundletool-0.13.2.jar(com.android.tools.build:无法下载资源:08Z.tools.build:无法下载资源https://dl.google.com/dl/android/maven2/com/android/tools/build/bundletool/0.13.2/bundletool-0.13.2.jar'。 > Premature end of Content-Length delimited message body (expected: 32,326,603; received: 2,359,280) Could not download builder-4.0.0.jar (com.android.tools.build:builder:4.0.0) > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/builder/4.0.0/builder-4.0.0.jar'.
> 内容长度分隔的消息正文过早结束(预期:32,326,603;收到:2,359,280)无法下载builder-4.0.0.jar(com.ZC31B32364CE19CA8FCD150A417ECCE50Z.tools.build:'4.08Z.tools.build) https://dl.google.com/dl/android/maven2/com/android/tools/build/builder/4.0.0/builder-4.0.0.jar'。 > Premature end of Content-Length delimited message body (expected: 9,052,896; received: 4,456,416)
> Content-Length 分隔的消息正文过早结束(预期:9,052,896;收到:4,456,416)
Try: Run with --stacktrace option to get the stack trace.尝试:使用 --stacktrace 选项运行以获取堆栈跟踪。 Run with --info or --debug option to get more log output.
使用 --info 或 --debug 选项运行以获得更多日志 output。 Run with --scan to get full insights.
运行 --scan 以获得完整的见解。
Get more help at https://help.gradle.org在https://help.gradle.org获得更多帮助
BUILD FAILED in 13m 48s Exception: Gradle task assembleDebug failed with exit code 1 BUILD FAILED in 13m 48s Exception: Gradle task assembleDebug failed with exit code 1
Have you tried running flutter clean
and flutter pub get
?您是否尝试过运行
flutter clean
和flutter pub get
? This usually solves common build errors.这通常可以解决常见的构建错误。 If that didn't solve the issue, you can rebuild the Flutter project's
/android
folder by deleting it and running flutter create --platform=android [PROJECT_PATH]
to generate the Android project again.如果这不能解决问题,您可以重建 Flutter 项目的
/android
文件夹,方法是删除它并运行flutter create --platform=android [PROJECT_PATH]
以再次生成 Android 项目。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.