Flutter运行-无法构建iOS应用-命令PhaseScriptExecution失败,退出代码非零 [英] Flutter run - Failed to build iOS app - Command PhaseScriptExecution failed with a nonzero exit code

查看:419
本文介绍了Flutter运行-无法构建iOS应用-命令PhaseScriptExecution失败,退出代码非零的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是 flutter run控制台输出的图像版本. /p>

这是 flutter doctor -v控制台输出的图像版本.

奔跑扑通跑给我:

'''''正在下载ios工具... 7.8秒 下载ios配置文件工具... 5.5s 正在下载ios发布工具... 34.0s 以调试模式在iPhone SE(第二代)上启动lib/main.dart ...

警告:缺少版本名称(CFBundleShortVersionString). 警告:缺少内部版本号(CFBundleVersion). 必需的操作:您必须先在pubspec.yaml文件版本字段中设置内部版本名称和编号,然后才能提交给应用 店铺. 正在运行Pod安装... 9.3s 正在运行Xcode构建...

Xcode构建完成. 89.9秒 无法构建iOS应用 Xcode构建错误输出: ↳ **建立失败**

Xcode的输出: ↳ ../.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:88:26:错误:类型 找不到"DiagnosticableMixin". DiagnosticableMixin类的PictureStream { ^^^^^^^^^^^^^^^^^^^^ ../.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:192:44:错误:类型 找不到"DiagnosticableMixin". 带有DiagnosticableMixin的抽象类PictureStreamCompleter { ^^^^^^^^^^^^^^^^^^^^ ../.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:88:7:错误:类型 不能混入"DiagnosticableMixin". DiagnosticableMixin类的PictureStream { ^ ../.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:192:16:错误:类型 不能混入"DiagnosticableMixin". 带有DiagnosticableMixin的抽象类PictureStreamCompleter { ^ ../.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:167:11:错误:超类没有 名为"debugFillProperties"的方法. super.debugFillProperties(properties); ^^^^^^^^^^^^^^^^^^^^ ../.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:171:30:错误:该方法 没有为"PictureStreamCompleter"类定义"toStringShort". -"PictureStreamCompleter"来自"package:flutter_svg/src/picture_stream.dart" ('../.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart'). 尝试将名称更正为现有方法的名称,或定义一个名为"toStringShort"的方法. ifPresent:_completer?.toStringShort(), ^^^^^^^^^^^^^^ ../.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:266:11:错误:超类没有 名为"debugFillProperties"的方法. super.debugFillProperties(description); ^^^^^^^^^^^^^^^^^^^^ p

Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description

无法为模拟器构建应用程序. 在iPhone SE(第二代)上启动应用程序时出错. '''

正在运行的扑打医生-v给了我

''' 正在下载android-arm-profile/darwin-x64工具... 1.1s 正在下载android-arm-release/darwin-x64工具... 0.9s 正在下载android-arm64-profile/darwin-x64工具... 1.7秒 正在下载android-arm64-release/darwin-x64工具... 1.0s 正在下载android-x64-profile/darwin-x64工具... 1.3s 正在下载android-x64-release/darwin-x64工具... 1.0s [✓] Flutter(频道主版本为1.20.0-1.0.pre.132,在Mac OS X 10.15.2 19C57上,语言环境为en-US) •位于/Users/lesleychang/flutter的Flutter版本1.20.0-1.0.pre.132 •Framework修订版5995661777(6小时前),2020-06-19 16:15:58 -0700 •发动机修订版676cd566f7 •Dart版本2.9.0(内部版本2.9.0-17.0.dev 7e72c9ae7e)

[✗] Android工具链-为Android设备开发 无法找到Android SDK. 从以下位置安装Android Studio: https://developer.android.com/studio/index.html 首次启动时,它将帮助您安装Android SDK组件. (或访问 https://flutter.dev/docs/get-started /install/macos#android-setup 了解详细说明). 如果Android SDK已安装到自定义位置,请将ANDROID_SDK_ROOT设置到该位置. 您可能还需要将其添加到PATH环境变量中.

[✓] Xcode-为iOS和macOS开发(Xcode 11.5) •Xcode位于/Applications/Xcode.app/Contents/Developer •Xcode 11.5,内部版本11E608c •CocoaPods版本1.9.3

[!] Android Studio(未安装) •找不到Android Studio;从 https://developer.android.com/studio/index.html 下载 (或访问 https://flutter.dev/docs/get-started /install/macos#android-setup 了解详细说明).

[✓]已连接的设备(1个可用)
•iPhone SE(第二代)•7305F6FC-57BD-4A00-A55D-FC6741E759C4•ios• com.apple.CoreSimulator.SimRuntime.iOS-13-5(模拟器)

!医生发现了2个类别的问题. '''

我根本无法在iOS模拟器上运行Flutter应用,而我看过类似的帖子也无济于事.关于做什么的任何指示?或者我可以尝试从其他社区获得帮助?谢谢!

解决方案

由于 https://github.com/flutter/flutter/pull/58635 ,您可以将flutter_svg升级到0.18.0,否则可以降级flutter.

Here's an image version of the console output for the flutter run.

Here's an image version of the console output for flutter doctor -v.

Running flutter run gives me:

'''Downloading ios tools... 7.8s Downloading ios-profile tools... 5.5s Downloading ios-release tools... 34.0s Launching lib/main.dart on iPhone SE (2nd generation) in debug mode...

Warning: Missing build name (CFBundleShortVersionString). Warning: Missing build number (CFBundleVersion). Action Required: You must set a build name and number in the pubspec.yaml file version field before submitting to the App Store. Running pod install... 9.3s Running Xcode build...

Xcode build done. 89.9s Failed to build iOS app Error output from Xcode build: ↳ ** BUILD FAILED **

Xcode's output: ↳ ../.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); ^^^^^^^^^^^^^^^^^^^

Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description

Could not build the application for the simulator. Error launching application on iPhone SE (2nd generation). '''

Running flutter doctor -v gives me:

''' Downloading android-arm-profile/darwin-x64 tools... 1.1s Downloading android-arm-release/darwin-x64 tools... 0.9s Downloading android-arm64-profile/darwin-x64 tools... 1.7s Downloading android-arm64-release/darwin-x64 tools... 1.0s Downloading android-x64-profile/darwin-x64 tools... 1.3s Downloading android-x64-release/darwin-x64 tools... 1.0s [✓] Flutter (Channel master, 1.20.0-1.0.pre.132, on Mac OS X 10.15.2 19C57, locale en-US) • Flutter version 1.20.0-1.0.pre.132 at /Users/lesleychang/flutter • Framework revision 5995661777 (6 hours ago), 2020-06-19 16:15:58 -0700 • Engine revision 676cd566f7 • Dart version 2.9.0 (build 2.9.0-17.0.dev 7e72c9ae7e)

[✗] Android toolchain - develop for Android devices ✗ Unable to locate Android SDK. Install Android Studio from: https://developer.android.com/studio/index.html On first launch it will assist you in installing the Android SDK components. (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions). If the Android SDK has been installed to a custom location, set ANDROID_SDK_ROOT to that location. You may also want to add it to your PATH environment variable.

[✓] Xcode - develop for iOS and macOS (Xcode 11.5) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 11.5, Build version 11E608c • CocoaPods version 1.9.3

[!] Android Studio (not installed) • Android Studio not found; download from https://developer.android.com/studio/index.html (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).

[✓] Connected device (1 available)
• iPhone SE (2nd generation) • 7305F6FC-57BD-4A00-A55D-FC6741E759C4 • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-5 (simulator)

! Doctor found issues in 2 categories. '''

I can't run my Flutter app on my iOS emulator at all and I've looked at similar posts to no avail. Any pointers on what to do? Or any other communities I can try getting help from? Thanks!

解决方案

Due to a breaking change made by https://github.com/flutter/flutter/pull/58635, you can upgrade flutter_svg to 0.18.0 or downgrade flutter otherwise.

这篇关于Flutter运行-无法构建iOS应用-命令PhaseScriptExecution失败,退出代码非零的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆