此版本中使用了已弃用的 Gradle 功能,使其与 Gradle 7.0 不兼容。扑

Den*_*zel 5 android gradle flutter

所以我最近换了一个flutter beta频道flutter 1.26.0 - 17.6.pre,我已经做了一个运行正常的web项目,所以最近我尝试做一个移动应用项目,它第一次构建,之后我一直保持从 gradle 获取此错误日志。

[+155045 ms] FAILURE: Build failed with an exception.
[  +55 ms] * What went wrong:
[        ] org/apache/http/pool/AbstractConnPool
[        ] * 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
[  +63 ms] Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
[        ] Use '--warning-mode all' to show the individual deprecation warnings.
[        ] See https://docs.gradle.org/6.7/userguide/command_line_interface.html#sec:command_line_warnings
[        ] BUILD FAILED in 2m 29s
[+3846 ms] Running Gradle task 'assembleDebug'... (completed in 158.9s)
[ +204 ms] Exception: Gradle task assembleDebug failed with exit code 1


Run Code Online (Sandbox Code Playgroud)

Dou*_*ark 0

到目前为止我所做的事情:

  1. 使用 --no-sound-null-safety 和 --verbose 运行
  2. 找到抱怨的依赖项并检查更新,然后更新到 pubspec 中的最新版本
  3. 一个依赖项抱怨 gradle.build 中的 android min sdk 版本,因此我进行了相应更新

现在我可以构建我的测试机器并解决运行时错误!