原因大概是 被墙,从而出现下载不了对应的文件导致的。
Flutter1.17.x版本的SDK包里的gradle构建工具,默认使用的仓库链接是国外服务器。
如上得知,被墙,从而因为出现下载不了对应的文件导致的。
错误信息截图
错误信息复制
可以通过复制自己的错误信息对照下或方便爬虫搜索。
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-b851c718295a896918dc93cb1ff14f2f895a1b90.
Required by:
project :app
> Skipped due to earlier error
> Skipped due to earlier error
> Skipped due to earlier error
> Could not resolve io.flutter:arm64_v8a_debug:1.0.0-b851c718295a896918dc93cb1ff14f2f895a1b90.
Required by:
project :app
> Skipped due to earlier error
> Skipped due to earlier error
> Skipped due to earlier error
> Could not resolve io.flutter:x86_debug:1.0.0-b851c718295a896918dc93cb1ff14f2f895a1b90.
Required by:
project :app
> Skipped due to earlier error
> Skipped due to earlier error
> Skipped due to earlier error
> Could not resolve io.flutter:x86_64_debug:1.0.0-b851c718295a896918dc93cb1ff14f2f895a1b90.
Required by:
project :app
> Skipped due to earlier error
> 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 3m 44s
Exception: Gradle task assembleDebug failed with exit code 1
通用解决办法
- 首先打开 你的FlutterSDK路径\packages\flutter_tools\gradle
例如我的是 D:\client\frameworks\flutter\packages\flutter_tools\gradle
然后把上图中选中的三个文件**
用记事本打开,
并把三个文件里所有的
https://storage.googleapis.com/download.flutter.io
替换成
http://download.flutter.io
解决!!