Flutter 示例 Hello world flutter 应用程序构建失败:任务 ':app:mergeDebugResources' 执行失败

时间:2021-03-21 18:24:16

标签: flutter

Flutter 示例 Hello world flutter 应用程序构建失败:任务 ':app:mergeDebugResources' 的执行失败

我最近安装了 flutter 并尝试运行由 flutter 创建的示例应用程序,但出现以下错误
操作系统 = Windows 10
代码没有改变(lib/main.dart)

[   +1 ms] > Task :app:mergeDebugJavaResource FAILED
[ +307 ms] > Task :app:desugarDebugFileDependencies FAILED
[   +6 ms] FAILURE: Build completed with 2 failures.
[   +3 ms] 1: Task failed with an exception.
[        ] -----------
[   +1 ms] * What went wrong:
[   +1 ms] Execution failed for task ':app:mergeDebugJavaResource'.
[   +2 ms] > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
[   +1 ms]    > java.lang.IllegalArgumentException (no error message)
[   +1 ms] * Try:
[   +1 ms] 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.
[   +2 ms] ==============================================================================
[   +1 ms] 2: Task failed with an exception.
[   +4 ms] -----------
[   +3 ms] * What went wrong:
[   +1 ms] Execution failed for task ':app:desugarDebugFileDependencies'.
[   +1 ms] > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
[   +1 ms]    > error in opening zip file
[   +1 ms] * 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.
[   +3 ms] ==============================================================================
[   +1 ms] * Get more help at https://help.gradle.org
[  +45 ms] Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
[   +1 ms] Use '--warning-mode all' to show the individual deprecation warnings.
[   +2 ms] See https://docs.gradle.org/6.7/userguide/command_line_interface.html#sec:command_line_warnings
[        ] 24 actionable tasks: 5 executed, 19 up-to-date
[   +1 ms] BUILD FAILED in 6s
[ +759 ms] Running Gradle task 'assembleDebug'... (completed in 7,8s)
[ +277 ms] Exception: Gradle task assembleDebug failed with exit code 1
[   +3 ms] "flutter run" took 10 298ms.
[   +5 ms]
           #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
           #1      RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:644:9)
           <asynchronous suspension>
           #2      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:1157:12)
           <asynchronous suspension>
           #3      FlutterCommand.run.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command.dart:1009:27)
           <asynchronous suspension>
           #4      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #5      AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
           <asynchronous suspension>
           #6      CommandRunner.runCommand (package:args/command_runner.dart:197:13)
           <asynchronous suspension>
           #7      FlutterCommandRunner.runCommand.<anonymous closure>
           (package:flutter_tools/src/runner/flutter_command_runner.dart:278:9)
           <asynchronous suspension>
           #8      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #9      AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
           <asynchronous suspension>
           #10     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:234:5)
           <asynchronous suspension>
           #11     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:64:9)
           <asynchronous suspension>
           #12     run.<anonymous closure> (package:flutter_tools/runner.dart:62:12)
           <asynchronous suspension>
           #13     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #14     AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
           <asynchronous suspension>
           #15     runInContext (package:flutter_tools/src/context_runner.dart:73:10)
           <asynchronous suspension>
           #16     main (package:flutter_tools/executable.dart:90:3)
           <asynchronous suspension>

0 个答案:

没有答案