flutter build apk 时提示 Gradle task assembleRelease failed with exit code 1

来源:20-1 .课程总结

PureTheYes

2019-06-25

flutter build apk 时提示 Gradle task assembleRelease failed with exit code 1

开发时是使用的 stable channel,前段时间也生成过apk没有任何问题
现在检测了各gradle脚本文件都没有错误提示,也可以flutter run运行,使用 flutter doctor命名检测也没问题,build之前也进行了 flutter clean
之后我也切换了 dev 和 master channel,除了因为使用fish_redux Action定义重复外,下面的错误提示都是一致的

以下为Log日志

Gradle task assembleRelease failed with exit code 1

#0      throwToolExit (package:flutter_tools/src/base/common.dart:28:3)
#1      _buildGradleProjectV2 (package:flutter_tools/src/android/gradle.dart:507:5)
<asynchronous suspension>
#2      buildGradleProject (package:flutter_tools/src/android/gradle.dart:346:14)
<asynchronous suspension>
#3      buildApk (package:flutter_tools/src/android/apk.dart:34:9)
<asynchronous suspension>
#4      BuildApkCommand.runCommand (package:flutter_tools/src/commands/build_apk.dart:79:11)
<asynchronous suspension>
#5      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:478:18)
<asynchronous suspension>
#6      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:383:33)
<asynchronous suspension>
#7      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:29)
<asynchronous suspension>
#8      _rootRun (dart:async/zone.dart:1124:13)
#9      _CustomZone.run (dart:async/zone.dart:1021:19)
#10     _runZoned (dart:async/zone.dart:1516:10)
#11     runZoned (dart:async/zone.dart:1463:12)
#12     AppContext.run (package:flutter_tools/src/base/context.dart:152:18)
<asynchronous suspension>
#13     FlutterCommand.run (package:flutter_tools/src/runner/flutter_command.dart:375:20)
#14     CommandRunner.runCommand (package:args/command_runner.dart:197:27)
<asynchronous suspension>
#15     FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:396:21)
<asynchronous suspension>
#16     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:29)
<asynchronous suspension>
#17     _rootRun (dart:async/zone.dart:1124:13)
#18     _CustomZone.run (dart:async/zone.dart:1021:19)
#19     _runZoned (dart:async/zone.dart:1516:10)
#20     runZoned (dart:async/zone.dart:1463:12)
#21     AppContext.run (package:flutter_tools/src/base/context.dart:152:18)
<asynchronous suspension>
#22     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:356:19)
<asynchronous suspension>
#23     CommandRunner.run.<anonymous closure> (package:args/command_runner.dart:112:25)
#24     new Future.sync (dart:async/future.dart:224:31)
#25     CommandRunner.run (package:args/command_runner.dart:112:14)
#26     FlutterCommandRunner.run (package:flutter_tools/src/runner/flutter_command_runner.dart:242:18)
#27     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:22)
<asynchronous suspension>
#28     _rootRun (dart:async/zone.dart:1124:13)
#29     _CustomZone.run (dart:async/zone.dart:1021:19)
#30     _runZoned (dart:async/zone.dart:1516:10)
#31     runZoned (dart:async/zone.dart:1500:12)
#32     run.<anonymous closure> (package:flutter_tools/runner.dart:60:18)
<asynchronous suspension>
#33     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:29)
<asynchronous suspension>
#34     _rootRun (dart:async/zone.dart:1124:13)
#35     _CustomZone.run (dart:async/zone.dart:1021:19)
#36     _runZoned (dart:async/zone.dart:1516:10)
#37     runZoned (dart:async/zone.dart:1463:12)
#38     AppContext.run (package:flutter_tools/src/base/context.dart:152:18)
<asynchronous suspension>
#39     runInContext (package:flutter_tools/src/context_runner.dart:56:24)
<asynchronous suspension>
#40     run (package:flutter_tools/runner.dart:51:10)
#41     main (package:flutter_tools/executable.dart:62:9)
<asynchronous suspension>
#42     main (file:///F:/Flutter/flutter/packages/flutter_tools/bin/flutter_tools.dart:8:3)
#43     _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32)
#44     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)

写回答

1回答

PureTheYes

提问者

2019-06-26

这个问题已经解决了,是一个plugin build realease时,资源文件异常导致的,因为没有此条日志没有红色表示而且不显眼导致我看漏了。

0
1
CrazyCodeBoy
好的,加油哦
2019-06-26
共1条回复

Flutter从入门到进阶 实战携程网App 一网打尽核心技术

解锁Flutter开发新姿势,,系统掌握Flutter开发核心技术。

4788 学习 · 3270 问题

查看课程