Skip to content

flutter build fails due visionOS #153917

@GusBricker

Description

@GusBricker

Steps to reproduce

  1. Use in_app_purchase
  2. Build for macOS 10.15

Expected results

Want to debug the app, can only run it with chrome

Actual results

flutter run
Connected devices:
macOS (desktop) • macos  • darwin-x64     • Mac OS X 10.15.7 19H2 darwin-x64
Chrome (web)    • chrome • web-javascript • Google Chrome 127.0.6533.120

No wireless devices were found.

[1]: macOS (macos)
[2]: Chrome (chrome)
Please choose one (or "q" to quit): 1

Resolving dependencies... (1.5s)
Downloading packages... 
  _fe_analyzer_shared 72.0.0 (73.0.0 available)
  analyzer 6.7.0 (6.8.0 available)
  collection 1.18.0 (1.19.0 available)
  http_parser 4.0.2 (4.1.0 available)
  material_color_utilities 0.11.1 (0.12.0 available)
  shelf 1.4.1 (1.4.2 available)
  string_scanner 1.2.0 (1.3.0 available)
  test_api 0.7.2 (0.7.3 available)
Got dependencies!
8 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.
Launching lib/main.dart on macOS in debug mode...
Running pod install...                                              8.3s
Command MergeSwiftModule failed with a nonzero exit code
#import "Headers/in_app_purchase_storekit-umbrella.h"
        ^
#import "FIAPaymentQueueHandler.h"
        ^
#import "FLTPaymentQueueHandlerProtocol.h"
        ^
#import "FLTPaymentQueueProtocol.h"
        ^
/Users/.../.pub-cache/hosted/pub.dev/in_app_purchase_storekit-0.3.17+3/darwin/Classes/Protocols/FLTPaymentQueueProtocol.h:17:50: error: expected ','
    ios(3.0), macos(10.7), watchos(6.2), visionos(1.0));
                                                 ^
#import "Headers/in_app_purchase_storekit-umbrella.h"
        ^
#import "FIAPaymentQueueHandler.h"
        ^
#import "FLTPaymentQueueHandlerProtocol.h"
        ^
#import "FLTPaymentQueueProtocol.h"
        ^
/Users/.../.pub-cache/hosted/pub.dev/in_app_purchase_storekit-0.3.17+3/darwin/Classes/Protocols/FLTPaymentQueueProtocol.h:21:52: error: expected ','
    ios(13.0), macos(10.15), watchos(6.2), visionos(1.0));
                                                   ^
#import "Headers/in_app_purchase_storekit-umbrella.h"
        ^
#import "FIAPaymentQueueHandler.h"
        ^
#import "FLTPaymentQueueHandlerProtocol.h"
        ^
#import "FLTPaymentQueueProtocol.h"
        ^
/Users/.../.pub-cache/hosted/pub.dev/in_app_purchase_storekit-0.3.17+3/darwin/Classes/Protocols/FLTPaymentQueueProtocol.h:38:60: error: expected ','
                                                   visionos(1.0));
                                                           ^
#import "Headers/in_app_purchase_storekit-umbrella.h"
        ^
#import "FIAPaymentQueueHandler.h"
        ^
#import "FLTPaymentQueueHandlerProtocol.h"
        ^
#import "FLTPaymentQueueProtocol.h"
        ^
/Users/.../.pub-cache/hosted/pub.dev/in_app_purchase_storekit-0.3.17+3/darwin/Classes/Protocols/FLTPaymentQueueProtocol.h:43:64: error: expected ','
    API_AVAILABLE(ios(7.0), macos(10.9), watchos(6.2), visionos(1.0));
                                                               ^
#import "Headers/in_app_purchase_storekit-umbrella.h"
        ^
#import "FIAPaymentQueueHandler.h"
        ^
#import "FLTPaymentQueueHandlerProtocol.h"
        ^
#import "FLTPaymentQueueProtocol.h"
        ^
/Users/.../.pub-cache/hosted/pub.dev/in_app_purchase_storekit-0.3.17+3/darwin/Classes/Protocols/FLTPaymentQueueProtocol.h:47:69: error: expected ','
- (void)presentCodeRedemptionSheet API_AVAILABLE(ios(14.0), visionos(1.0))
                                                                    ^
#import "Headers/in_app_purchase_storekit-umbrella.h"
        ^
#import "FIAPaymentQueueHandler.h"
        ^
#import "FLTPaymentQueueHandlerProtocol.h"
        ^
#import "FLTPaymentQueueProtocol.h"
        ^
/Users/.../.pub-cache/hosted/pub.dev/in_app_purchase_storekit-0.3.17+3/darwin/Classes/Protocols/FLTPaymentQueueProtocol.h:54:67: error: expected ','
- (void)showPriceConsentIfNeeded API_AVAILABLE(ios(13.4), visionos(1.0))
                                                                  ^
<unknown>:0: error: could not build Objective-C module 'in_app_purchase_storekit'
** BUILD FAILED **

Building macOS application...                                           
Error: Build process failed

Code sample

name: testapp
description: "My test app"
# The following line prevents the package from being accidentally published to
# pub.dev using `flutter pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 1.0.0+1

environment:
  sdk: '>=3.4.4 <4.0.0'

# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
# consider running `flutter pub upgrade --major-versions`. Alternatively,
# dependencies can be manually updated by changing the version numbers below to
# the latest version available on pub.dev. To see which dependencies have newer
# versions available, run `flutter pub outdated`.
dependencies:
  flutter:
    sdk: flutter
  file_picker: ^8.0.6
  http: ^1.2.2
  reactive_forms: ^17.0.1
  reactive_file_picker: ^3.0.0
  mime: ^1.0.5
  in_app_purchase: ^3.2.0
  hive: ^2.0.4
  hive_flutter: ^1.1.0
  path_provider: ^2.0.11

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^1.0.6

dev_dependencies:
  flutter_test:
    sdk: flutter
  build_runner: ^2.1.7
  hive_generator: ^2.0.1
  
  # The "flutter_lints" package below contains a set of recommended lints to
  # encourage good coding practices. The lint set provided by the package is
  # activated in the `analysis_options.yaml` file located at the root of your
  # package. See that file for information about deactivating specific lint
  # rules and activating additional ones.
  flutter_lints: ^4.0.0

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter packages.
flutter:

  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true

  # To add assets to your application, add an assets section, like this:
  # assets:
  #   - images/a_dot_burr.jpeg
  #   - images/a_dot_ham.jpeg

  # An image asset can refer to one or more resolution-specific "variants", see
  # https://flutter.dev/assets-and-images/#resolution-aware

  # For details regarding adding assets from package dependencies, see
  # https://flutter.dev/assets-and-images/#from-packages

  # To add custom fonts to your application, add a fonts section here,
  # in this "flutter" section. Each entry in this list should have a
  # "family" key with the font family name, and a "fonts" key with a
  # list giving the asset and other descriptors for the font. For
  # example:
  # fonts:
  #   - family: Schyler
  #     fonts:
  #       - asset: fonts/Schyler-Regular.ttf
  #       - asset: fonts/Schyler-Italic.ttf
  #         style: italic
  #   - family: Trajan Pro
  #     fonts:
  #       - asset: fonts/TrajanPro.ttf
  #       - asset: fonts/TrajanPro_Bold.ttf
  #         weight: 700
  #
  # For details regarding fonts from package dependencies,
  # see https://flutter.dev/custom-fonts/#from-packages

Screenshots or Video

No response

Logs

No response

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.24.1, on Mac OS X 10.15.7 19H2 darwin-x64, locale en-AU)
[✗] Android toolchain - develop for Android devices
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
[!] Xcode - develop for iOS and macOS (Xcode 12.4)
    ✗ Flutter requires Xcode 14 or higher.
      Download the latest version or update via the Mac App Store.
[✓] Chrome - develop for the web
[!] Android Studio (not installed)
[✓] VS Code (version 1.85.2)
[✓] Connected device (2 available)
[✓] Network resources

! Doctor found issues in 3 categories.

Metadata

Metadata

Assignees

No one assigned

    Labels

    r: invalidIssue is closed as not valid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions