Skip to content

flutter install demands unsupported --flavor option #99607

Closed

Description

@mleonhard

Steps to Reproduce

See steps in #98151 .

Here are my steps:

$ flutter build ios -t lib/main_staging.dart --flavor=staging --release
...

$ flutter install --device-id=nnn
The Xcode project defines schemes: local, prod, staging
You must specify a --flavor option to select one of the available schemes.

$ flutter install --device-id=nnn --flavor=staging
Could not find an option named "flavor".
Run 'flutter -h' (or 'flutter <command> -h') for available flutter commands and options.

Activity

  1. mleonhard commented on Mar 5, 2022

    @mleonhard
    ContributorAuthor

    I tried running flutter build ios -t lib/main_staging.dart --flavor=staging --release and then immediately installing manually with XCode. This installed the app with a Flutter DEBUG build. It did use the proper Xcode profile.

  2. mleonhard commented on Mar 5, 2022

    @mleonhard
    ContributorAuthor

    To work around Flutter's broken tooling:

    1. flutter build ios -t lib/main_staging.dart --flavor=staging --release
    2. Connect your device and unlock it. This assumes you have already set up your device to work with flutte run.
    3. Launch XCode.
    4. Select the menu option Window > Devices and Simulators
    5. Select your device from the list on the left.
    6. Under Installed Apps, click the + button and select the app file created by flutter build:
      • build/ios/iphoneos/Runner
      • Note that this is actually the directory Runner.app/ but the selection dialog displays it as Runner.
  3. darshankawar commented on Mar 7, 2022

    @darshankawar
    Member

    Thanks for the report. Tried the same scenario using flavors_example app in which getting same error as reported:

    dhs@Dhss-MacBook-Pro flavors_example % flutter build ios -t lib/main_staging.dart --flavor=staging --release
    Downloading ios tools...                                            7.6s
    Downloading ios-profile tools...                                    5.5s
    Downloading ios-release tools...                                   26.0s
    Target file "lib/main_staging.dart" not found.
    dhs@Dhss-MacBook-Pro flavors_example % flutter build ios -t lib/main_dev.dart --flavor=staging --release
    Running "flutter pub get" in flavors_example...                  1,575ms
    This app is using a deprecated version of the Android embedding.
    To avoid unexpected runtime failures, or future build failures, try to migrate this app to the V2 embedding.
    Take a look at the docs for migrating an app: https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects
    
    The Xcode project defines schemes: dev, Runner
    You must specify a --flavor option to select one of the available schemes.
    dhs@Dhss-MacBook-Pro flavors_example % flutter install --device-id=21150b119064aecc249dfcfe05e259197461ce23 --flavor=dev
    Could not find an option named "flavor".
    
    
    Run 'flutter -h' (or 'flutter <command> -h') for available flutter commands and options.
    dhs@Dhss-MacBook-Pro flavors_example % 
    
    
    stable, master flutter doctor -v
    
    [✓] Flutter (Channel stable, 2.10.3, on macOS 12.2.1 21D62 darwin-x64, locale
        en-GB)
        • Flutter version 2.10.3 at /Users/dhs/documents/fluttersdk/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 7e9793dee1 (11 hours ago), 2022-03-02 11:23:12 -0600
        • Engine revision bd539267b4
        • Dart version 2.16.1
        • DevTools version 2.9.2
    
    [!] Xcode - develop for iOS and macOS (Xcode 12.3)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        ! Flutter recommends a minimum Xcode version of 13.
          Download the latest version or update via the Mac App Store.
        • CocoaPods version 1.11.2
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] VS Code (version 1.62.0)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.21.0
    
    [✓] Connected device (5 available)
        • SM G975F (mobile)       • RZ8M802WY0X • android-arm64   • Android 11 (API 30)
        • Darshan's iphone (mobile)  • 21150b119064aecc249dfcfe05e259197461ce23 •
          ios            • iOS 14.4.1 18D61
        • iPhone 12 Pro Max (mobile) • A5473606-0213-4FD8-BA16-553433949729     •
          ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator)
        • macOS (desktop)            • macos                                    •
          darwin-x64     • Mac OS X 10.15.4 19E2269 darwin-x64
        • Chrome (web)               • chrome                                   •
          web-javascript • Google Chrome 98.0.4758.80
    
    [✓] HTTP Host Availability
        • All required HTTP hosts are available
    
    ! Doctor found issues in 1 category.
    
    
    [✓] Flutter (Channel master, 2.11.0-0.0.pre.795, on macOS 12.2.1 21D62
        darwin-x64, locale en-GB)
        • Flutter version 2.11.0-0.0.pre.795 at
          /Users/dhs/documents/fluttersdk/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 78039ea4f3 (2 hours ago), 2022-03-06 21:51:15 -0500
        • Engine revision 1875f0ad3f
        • Dart version 2.17.0 (build 2.17.0-181.0.dev)
        • DevTools version 2.11.1
    
    [!] Xcode - develop for iOS and macOS (Xcode 12.3)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        ! Flutter recommends a minimum Xcode version of 13.
          Download the latest version or update via the Mac App Store.
        • CocoaPods version 1.11.2
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] VS Code (version 1.62.0)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.21.0
    
    [✓] Connected device (5 available)
        • SM G975F (mobile)       • RZ8M802WY0X • android-arm64   • Android 11 (API 30)
        • Darshan's iphone (mobile)  • 21150b119064aecc249dfcfe05e259197461ce23 •
          ios            • iOS 14.4.1 18D61
        • iPhone 12 Pro Max (mobile) • A5473606-0213-4FD8-BA16-553433949729     •
          ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator)
        • macOS (desktop)            • macos                                    •
          darwin-x64     • Mac OS X 10.15.4 19E2269 darwin-x64
        • Chrome (web)               • chrome                                   •
          web-javascript • Google Chrome 98.0.4758.80
    
    [✓] HTTP Host Availability
        • All required HTTP hosts are available
    
    ! Doctor found issues in 1 category.
    
    
    
  4. added
    t: flutter doctorProblem related to the "flutter doctor" tool
    toolAffects the "flutter" command-line tool. See also t: labels.
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    and removed
    t: flutter doctorProblem related to the "flutter doctor" tool
    in triagePresently being triaged by the triage team
    on Mar 7, 2022
  5. darshankawar commented on Mar 7, 2022

    @darshankawar
    Member
  6. added
    P2Important issues not at the top of the work list
    on Mar 8, 2022
  7. jmagman commented on Mar 31, 2022

    @jmagman
    Member

    This is definitely confusing. flutter install is trying to figure out where the prebuilt binary is, and to do that it tries to get the FULL_PRODUCT_NAME from your Xcode build settings. But to do that it needs to know the right configuration (flavor) to use.
    Also flutter install should add --use-application-binary like drive and run so it doesn't need to rebuild the app.

  8. jmagman commented on Apr 6, 2022

    @jmagman
    Member

    While it doesn't fix the issue of the warning instructing to use a non-existent --flavor flag, #101324 will at least make installing a flavored IPA possible

    $ flutter build ipa --flavor free --export-method ad-hoc
    Archiving dev.flutter.flavors.free...
    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.
    Automatically signing iOS for device deployment using specified development team in Xcode project: S8QB4VV633
    Running Xcode build...
     └─Compiling, linking and signing...                         4.0s
    Xcode archive done.                                         17.4s
    Built /Users/m/Projects/flutter/dev/integration_tests/flavors/build/ios/archive/Free App.xcarchive.
    
    💪 Building with sound null safety 💪
    
    Building ad-hoc IPA...                                              6.3s
    Built IPA to /Users/m/Projects/flutter/dev/integration_tests/flavors/build/ios/ipa.
    

    And

    $ flutter install --use-application-binary build/ios/ipa/Free\ App.ipa
    Installing dev.flutter.flavors.free to iPad...
    $ flutter install --use-application-binary build/ios/ipa/Free\ App.ipa --uninstall-only
    Uninstalling dev.flutter.flavors.free from iPad...
    
  9. jmagman commented on Oct 25, 2022

    @jmagman
    Member

    cc @a-wallen @christopherfujino who were looking at a similar issue for create.

  10. christopherfujino commented on Oct 25, 2022

    @christopherfujino
    Contributor

    note to self: I think the right fix here would be to implement --flavor for flutter install.

  11. self-assigned this
    on Oct 25, 2022
  12. added
    r: fixedIssue is closed as already fixed in a newer version
    on Nov 9, 2022
  13. github-actions commented on Nov 23, 2022

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  14. locked as resolved and limited conversation to collaborators on Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listfound in release: 2.10Found to occur in 2.10found in release: 2.11Found to occur in 2.11has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specificallyr: fixedIssue is closed as already fixed in a newer versiontoolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions