Flutter run - Failed to build iOS app - Command PhaseScriptExecution failed with a nonzero exit code

8,550

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.

Share:
8,550
Admin
Author by

Admin

Updated on December 21, 2022

Comments

  • Admin
    Admin over 1 year

    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!