Gradle任务assembleDebug失败,退出代码为1

时间:2019-06-23 22:11:58

标签: android gradle flutter

我将项目迁移到androidX并添加到pubspec文件中, fluttery_audio:^ 0.0.4

我遇到此错误,该如何解决?

这是抖动运行-v的日志

Gradle task assembleDebug failed with exit code 1

#0      throwToolExit (package:flutter_tools/src/base/common.dart:24:3)
#1      _buildGradleProjectV2 (package:flutter_tools/src/android/gradle.dart:509: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      AndroidDevice.startApp (package:flutter_tools/src/android/android_device.dart:422:13)
<asynchronous suspension>
#5      FlutterDevice.runHot (package:flutter_tools/src/resident_runner.dart:371:54)
<asynchronous suspension>
#6      HotRunner.run (package:flutter_tools/src/run_hot.dart:253:39)
<asynchronous suspension>
#7      RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:489:37)
<asynchronous suspension>
#8      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:508:18)
<asynchronous suspension>
#9      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:413:33)
<asynchronous suspension>
#10     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:29)
<asynchronous suspension>
#11     _rootRun (dart:async/zone.dart:1124:13)
#12     _CustomZone.run (dart:async/zone.dart:1021:19)
#13     _runZoned (dart:async/zone.dart:1516:10)
#14     runZoned (dart:async/zone.dart:1463:12)
#15     AppContext.run (package:flutter_tools/src/base/context.dart:152:18)
<asynchronous suspension>

1 个答案:

答案 0 :(得分:0)

您使用的是旧版本的fluttery_audio,或者您的项目尚未正确迁移到AndroidX,因此我在遇到类似错误时手动迁移了我的代码。使用此https://flutter.dev/docs/development/packages-and-plugins/androidx-compatibility。希望有帮助