Flutter - 命令 PhaseScriptExecution 失败,退出代码非零

Lut*_*ris 5 xcode ios flutter

我正在尝试存档和构建 flutter IOS 项目,以便最终生成 IPA,但由于此错误而苦苦挣扎,我尝试遵循有关我无法解决的类似问题的现有问题:

../../../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
Run Code Online (Sandbox Code Playgroud)

导致此问题的原因是什么?

Rav*_*mar 7

我的情况是这样的,我使用了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
Run Code Online (Sandbox Code Playgroud)


Lut*_*ris 4

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

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