我试图在真实设备上运行我的flutter应用程序,但这给了我这个错误
无法确定任务':app:compileDebugJavaWithJavac'的依赖关系。
无法解决配置':app:debugCompileClasspath'的所有任务依赖项。
无法解析io.flutter:arm64_v8a_debug:1.0.0-af51afceb8886cc11e25047523c4e0c7e1f5d408。
Required by:
project :app
> Could not resolve io.flutter:arm64_v8a_debug:1.0.0-af51afceb8886cc11e25047523c4e0c7e1f5d408.
> Could not get resource 'https://dl.google.com/dl/android/maven2/io/flutter/arm64_v8a_debug/1.0.0-af51afceb8886cc11e25047523c4e0c7e1f5d408/arm64_v8a_debug-1.0.0-af51afceb8886cc11e25047523c4e0c7e1f5d408.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/io/flutter/arm64_v8a_debug/1.0.0-af51afceb8886cc11e25047523c4e0c7e1f5d408/arm64_v8a_debug-1.0.0-af51afceb8886cc11e25047523c4e0c7e1f5d408.pom'.
> dl.google.com
> Could not resolve io.flutter:arm64_v8a_debug:1.0.0-af51afceb8886cc11e25047523c4e0c7e1f5d408.
> Could not get resource 'https://jcenter.bintray.com/io/flutter/arm64_v8a_debug/1.0.0-af51afceb8886cc11e25047523c4e0c7e1f5d408/arm64_v8a_debug-1.0.0-af51afceb8886cc11e25047523c4e0c7e1f5d408.pom'.
> Could not GET 'https://jcenter.bintray.com/io/flutter/arm64_v8a_debug/1.0.0-af51afceb8886cc11e25047523c4e0c7e1f5d408/arm64_v8a_debug-1.0.0-af51afceb8886cc11e25047523c4e0c7e1f5d408.pom'.
> jcenter.bintray.com
> Could not resolve io.flutter:arm64_v8a_debug:1.0.0-af51afceb8886cc11e25047523c4e0c7e1f5d408.
> Could not get resource 'http://download.flutter.io/io/flutter/arm64_v8a_debug/1.0.0-af51afceb8886cc11e25047523c4e0c7e1f5d408/arm64_v8a_debug-1.0.0-af51afceb8886cc11e25047523c4e0c7e1f5d408.pom'.
> Could not GET 'http://download.flutter.io/io/flutter/arm64_v8a_debug/1.0.0-af51afceb8886cc11e25047523c4e0c7e1f5d408/arm64_v8a_debug-1.0.0-af51afceb8886cc11e25047523c4e0c7e1f5d408.pom'.
> download.flutter.io
> Could not resolve io.flutter:arm64_v8a_debug:1.0.0-af51afceb8886cc11e25047523c4e0c7e1f5d408.
> Could not get resource 'http://download.flutter.io/io/flutter/arm64_v8a_debug/1.0.0-af51afceb8886cc11e25047523c4e0c7e1f5d408/arm64_v8a_debug-1.0.0-af51afceb8886cc11e25047523c4e0c7e1f5d408.pom'.
> Could not GET 'http://download.flutter.io/io/flutter/arm64_v8a_debug/1.0.0-af51afceb8886cc11e25047523c4e0c7e1f5d408/arm64_v8a_debug-1.0.0-af51afceb8886cc11e25047523c4e0c7e1f5d408.pom'.
> download.flutter.io
> Could not resolve io.flutter:arm64_v8a_debug:1.0.0-af51afceb8886cc11e25047523c4e0c7e1f5d408.
> Could not get resource 'http://download.flutter.io/io/flutter/arm64_v8a_debug/1.0.0-af51afceb8886cc11e25047523c4e0c7e1f5d408/arm64_v8a_debug-1.0.0-af51afceb8886cc11e25047523c4e0c7e1f5d408.pom'.
> Could not GET 'http://download.flutter.io/io/flutter/arm64_v8a_debug/1.0.0-af51afceb8886cc11e25047523c4e0c7e1f5d408/arm64_v8a_debug-1.0.0-af51afceb8886cc11e25047523c4e0c7e1f5d408.pom'.
> download.flutter.io
如果有人知道如何解决,请提供帮助。
答案 0 :(得分:1)
> Could not GET 'http://
建议您的互联网无法正常工作。也许您正在使用VPN?在这种情况下,请将其暂停几分钟。如果不是,那是另一个与互联网相关的问题...
答案 1 :(得分:0)
我遇到了类似的问题:
$ flutter run
Running "flutter pub get" in flutter_sample... 886ms
Launching lib/main.dart on SM G955F in debug mode...
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
> Could not resolve io.flutter:flutter_embedding_debug:1.0.0-5d8bf811b3072390933d69f3e289a4bb673636c4.
Required by:
project :app
> Skipped due to earlier error
> Skipped due to earlier error
> Could not resolve io.flutter:arm64_v8a_debug:1.0.0-5d8bf811b3072390933d69f3e289a4bb673636c4.
Required by:
project :app
> Skipped due to earlier error
> Skipped due to earlier error
* 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 1m 35s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 97.9s
解决方案是:
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
com.android.tools.build:gradle:4.1.0
中升级到依赖项 build.gradle