【问题标题】:Android Studio Flutter Failure with Gradle Exception带有 Gradle 异常的 Android Studio Flutter 失败
【发布时间】:2020-07-09 21:13:00
【问题描述】:

我在 macOS 10.15.5 Catalina 上运行它。我最近能够在 quemu e86 模拟器中运行这个应用程序,但最近我遇到了一些问题,现在我遇到了奇怪的 Gradle 错误。

我会先声明我的颤动完全是 fubar'd 并且无论我将路径添加到我的 .bash_profile 多少次,我都无法在终端中运行颤振医生或任何与颤振相关的东西。相信我,我查看了许多其他文章试图弄清楚这一点,但到目前为止我还没有运气。

    Launching lib/main.dart on sdk gphone x86 arm in debug mode...
Running Gradle task 'assembleDebug'...
../../.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:88:26: Error: Type 'DiagnosticableMixin' not found.
class PictureStream with DiagnosticableMixin {
                         ^^^^^^^^^^^^^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:192:44: Error: Type 'DiagnosticableMixin' not found.
abstract class PictureStreamCompleter with DiagnosticableMixin {
                                           ^^^^^^^^^^^^^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:88:7: Error: The type 'DiagnosticableMixin' can't be mixed in.
class PictureStream with DiagnosticableMixin {
      ^
../../.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:192:16: Error: The type 'DiagnosticableMixin' can't be mixed in.
abstract class PictureStreamCompleter with DiagnosticableMixin {
               ^
../../.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:167:11: Error: Superclass has no method named 'debugFillProperties'.
    super.debugFillProperties(properties);
          ^^^^^^^^^^^^^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:171:30: Error: The method 'toStringShort' isn't defined for the class 'PictureStreamCompleter'.
 - 'PictureStreamCompleter' is from 'package:flutter_svg/src/picture_stream.dart' ('../../.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart').
Try correcting the name to the name of an existing method, or defining a method named 'toStringShort'.
      ifPresent: _completer?.toStringShort(),
                             ^^^^^^^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:266:11: Error: Superclass has no method named 'debugFillProperties'.
    super.debugFillProperties(description);
          ^^^^^^^^^^^^^^^^^^^


FAILURE: Build failed with an exception.

* Where:
Script '/Users/edperez/Developer/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 896

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/Users/edperez/Developer/flutter/bin/flutter'' finished with non-zero exit value 1

* 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 36s
Exception: Gradle task assembleDebug failed with exit code 1

我正在失去理智。谢谢!

【问题讨论】:

    标签: android-studio flutter gradle


    【解决方案1】:

    您的颤振缓存中可能存在错误。在您的终端中运行这些,看看它们是否可以帮助您:

    flutter pub cache repair 
    flutter clean
    

    【讨论】:

    • 嘿@P4yam,谢谢你的建议。不幸的是,由于我的颤动现在可能非常非常混乱,我的 bash 窗口只吐出-bash: flutter: command not found
    • 另外,我会说我更改了我正在使用的 Mac 上其他用户之一的名称。这可能是我的颤振安装或你拥有的东西。我通过 Sys...Prefs.app 中的用户和组为自己创建了一个新管理员,但这不会对事情产生太大影响,对吧?
    • @EduardoPerez 我以前在我的 linux 系统上遇到过同样的问题。您可以做的最后一件事是完全移除颤振和飞镖,然后重新安装。
    猜你喜欢
    • 2019-09-08
    • 2021-01-06
    • 1970-01-01
    • 1970-01-01
    • 2020-08-05
    • 2017-05-10
    • 1970-01-01
    • 2021-06-28
    • 2021-10-01
    相关资源
    最近更新 更多