FAILURE:构建失败并出现异常。无法解析所有文件以进行配置
Posted
技术标签:
【中文标题】FAILURE:构建失败并出现异常。无法解析所有文件以进行配置【英文标题】:FAILURE: Build failed with an exception. Could not resolve all files for configuration 【发布时间】:2021-12-25 22:16:53 【问题描述】:我在安装一些依赖项时遇到问题:
dependencies:
youtube_player_iframe: ^2.2.2
当我运行颤振并抛出一些错误时:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':flutter_local_notifications:compileDebugJavaWithJavac'.
> Could not resolve all files for configuration ':flutter_local_notifications:debugCompileClasspath'.
> Could not download threetenbp-1.4.2-no-tzdb.jar (org.threeten:threetenbp:1.4.2)
> Could not get resource 'https://repo.maven.apache.org/maven2/org/threeten/threetenbp/1.4.2/threetenbp-1.4.2-no-tzdb.jar'.
> Could not GET 'https://repo.maven.apache.org/maven2/org/threeten/threetenbp/1.4.2/threetenbp-1.4.2-no-tzdb.jar'.
> This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server (repo.maven.apache.org)
* 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 20s
[!] Gradle threw an error while downloading artifacts from the network. Retrying to download...
Exception: Gradle task assembleDebug failed with exit code 1
有没有办法解决这个问题?
【问题讨论】:
正如这里提到的 ** 没有收到来自权威服务器 (repo.maven.apache.org) 的响应** 也许你忘记将 maven 依赖添加到你的 gradle 文件或者网络连接丢失请将您的 gradle 文件内容添加到帖子中与您一起解决! 【参考方案1】:关闭防火墙即可:)
【讨论】:
以上是关于FAILURE:构建失败并出现异常。无法解析所有文件以进行配置的主要内容,如果未能解决你的问题,请参考以下文章
Flutter - FAILURE:构建失败并出现异常。 - 无法启动守护进程。 - 安卓工作室 - VSCode
Flutter:FAILURE:构建失败,出现异常无法创建任务':app:compileFlutterBuildDebug'。必须提供 Flutter 源码目录