【问题标题】:Flutter - Command PhaseScriptExecution failed with a nonzero exit code [duplicate]Flutter - 命令 PhaseScriptExecution 失败,退出代码非零 [重复]
【发布时间】:2020-10-08 10:57:55
【问题描述】:

我正在尝试存档和构建 Flutter IOS 项目,以便最终生成 IPA,但由于此错误而苦苦挣扎,我尝试关注有关 similar 问题的现有问题我无法得到它:

../../../desktop/flutter/.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 {
                         ^^^^^^^^^^^^^^^^^^^
../../../desktop/flutter/.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 {
                                           ^^^^^^^^^^^^^^^^^^^
../../../desktop/flutter/.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 {
      ^
../../../desktop/flutter/.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 {
               ^
../../../desktop/flutter/.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);
          ^^^^^^^^^^^^^^^^^^^
../../../desktop/flutter/.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' ('../../../desktop/flutter/.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(),
                             ^^^^^^^^^^^^^
../../../desktop/flutter/.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);
          ^^^^^^^^^^^^^^^^^^^

Command PhaseScriptExecution failed with a nonzero exit code

这个问题的原因可能是什么?

【问题讨论】:

  • 同样的问题,很奇怪。

标签: ios xcode flutter


【解决方案1】:

我的情况是这样的,我使用了websafe_svg 1.1.0,它依赖于flutter_svg ^0.17.4。正如 @Lutaaya Huzaifah Idris 所建议的,此问题已在 flutter_svg: ^0.18.0 的最新更新中得到修复。

因此,如果您使用websafe_svg,则在pubspec.yaml 中添加以下行来解决此问题,

dependency_overrides:
  flutter_svg: ^0.18.0

【讨论】:

    【解决方案2】:

    我所做的是将我的 flutter_svg 包降级为 flutter_svg: ^0.17.4,然后构建通过了。

    我认为对于颤振的情况,当发生此错误时,很可能是您的软件包有问题。首先运行flutter pub get 看看它是否有效,或者尝试flutter clean。如果所有软件包都运行良好,那么您在 IOS 中的构建将通过。

    【讨论】:

    • 解决了我的问题!
    【解决方案3】:

    我也遇到了同样的问题,我只是降级我的颤振版本适合我。

    从(https://github.com/flutter/flutter)、Clickhere to see attached image获取最新的标签版本的flutter

    进入你的flutter目录并运行

    git checkout v1.16.3

    完成后,转到您的 VS 终端并运行颤振医生。让它完成。重新启动您的 VS(编辑器)。您现在可以构建它。

    【讨论】:

      猜你喜欢
      • 2020-06-27
      • 2020-12-18
      • 2021-04-30
      • 1970-01-01
      • 1970-01-01
      • 2022-07-30
      • 2020-10-25
      • 2021-02-03
      • 2019-07-23
      相关资源
      最近更新 更多