Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flutter create fails when using flavors #72329

Open
harsimranmaan opened this issue Dec 15, 2020 · 26 comments
Open

flutter create fails when using flavors #72329

harsimranmaan opened this issue Dec 15, 2020 · 26 comments
Labels
c: crash Stack traces logged to the console P2 Important issues not at the top of the work list team-tool Owned by Flutter Tool team tool Affects the "flutter" command-line tool. See also t: labels. triaged-tool Triaged by Flutter Tool team

Comments

@harsimranmaan
Copy link

Steps to Reproduce

  1. Add flavors to the flutter app. eg: dev and prod
  2. Switch to beta channel to enable web
  3. Try to bootstrap the web app with flutter create . as listed in https://flutter.dev/docs/get-started/web#add-web-support-to-an-existing-app

Logs

$ flutter create --platforms web .

The Xcode project defines schemes: dev, prod
You must specify a --flavor option to select one of the available schemes.
flutter create --flavor=dev  --platforms web .
Could not find an option named "flavor".


Run 'flutter -h' (or 'flutter <command> -h') for available flutter commands and options.
✓] Flutter (Channel beta, 1.24.0-10.2.pre, on macOS 11.0.1 20B50 darwin-x64, locale en-CA)
    • Flutter version 1.24.0-10.2.pre at /Users/name/flutter
    • Framework revision 022b333a08 (4 weeks ago), 2020-11-18 11:35:09 -0800
    • Engine revision 07c1eed46b
    • Dart version 2.12.0 (build 2.12.0-29.10.beta)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/name/Library/Android/sdk
    • Platform android-30, build-tools 30.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.3, Build version 12C33
    • CocoaPods version 1.10.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] VS Code (version 1.52.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.17.0

[✓] Connected device (3 available)
    • iPhone 12 Pro Max (mobile) • 00F296F5-A013-4EA6-BA46-D6DC80786241 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator)
    • Web Server (web)           • web-server                           • web-javascript • Flutter Tools
    • Chrome (web)               • chrome                               • web-javascript • Google Chrome 87.0.4280.88

• No issues found!
@harsimranmaan
Copy link
Author

The app flavor setup can be found in https://github.com/bigpanther/shipanther. Relates bigpanther/shipanther#168

@pedromassangocode
Copy link

flutter create --flavor=dev  --platforms web .
Could not find an option named "flavor".

Hi @harsimranmaan for what I know the flutter create command does not have the --flavor option. You can see all available options by running flutter create -h:

flutter create -h
MacBook-Pro-de-MacBook:flutter_example pedromassango$ flutterb create -h
Create a new Flutter project.

If run on a project that already exists, this will repair the project, recreating any files that are missing.

Global options:
-h, --help                  Print this usage information.
-v, --verbose               Noisy logging, including all shell commands executed.
                            If used with --help, shows hidden options.
-d, --device-id             Target device id or name (prefixes allowed).
    --version               Reports the version of this tool.
    --suppress-analytics    Suppress analytics reporting when this command runs.

Usage: flutter create <output directory>
-h, --help                     Print this usage information.
    --platforms                The platforms supported by this project. This argument only works when the
                               --template is set to app or plugin. Platform folders (e.g. android/) will be
                               generated in the target project. When adding platforms to a plugin project, the
                               pubspec.yaml will be updated with the requested platform. Adding desktop platforms
                               requires the corresponding desktop config setting to be enabled.
                               [ios (default), android (default), windows (default), linux (default), macos
                               (default), web (default)]
    --[no-]pub                 Whether to run "flutter pub get" after the project has been created.
                               (defaults to on)
    --[no-]offline             When "flutter pub get" is run by the create command, this indicates whether to run
                               it in offline mode or not. In offline mode, it will need to have all dependencies
                               already available in the pub cache to succeed.
    --[no-]with-driver-test    (Deprecated) Also add a flutter_driver dependency and generate a sample 'flutter
                               drive' test. This flag has been deprecated, instead see package:integration_test at
                               https://pub.dev/packages/integration_test .
-t, --template=<type>          Specify the type of project to create.

          [app]                (default) Generate a Flutter application.
          [module]             Generate a project to add a Flutter module to an existing Android or iOS
                               application.
          [package]            Generate a shareable Flutter project containing modular Dart code.
          [plugin]             Generate a shareable Flutter project containing an API in Dart code with a
                               platform-specific implementation for Android, for iOS code, or for both.

-s, --sample=<id>              Specifies the Flutter code sample to use as the main.dart for an application.
                               Implies --template=app. The value should be the sample ID of the desired sample
                               from the API documentation website (http://docs.flutter.dev). An example can be
                               found at
                               https://master-api.flutter.dev/flutter/widgets/SingleChildScrollView-class.html
    --list-samples=<path>      Specifies a JSON output file for a listing of Flutter code samples that can be
                               created with --sample.
    --[no-]overwrite           When performing operations, overwrite existing files.
    --description              The description to use for your new Flutter project. This string ends up in the
                               pubspec.yaml file.
                               (defaults to "A new Flutter project.")
    --org                      The organization responsible for your new Flutter project, in reverse domain name
                               notation. This string is used in Java package names and as prefix in the iOS bundle
                               identifier.
                               (defaults to "com.example")
    --project-name             The project name for this new Flutter project. This must be a valid dart package
                               name.
-i, --ios-language             [objc, swift (default)]
-a, --android-language         [java, kotlin (default)]

Run "flutter help" to see global options.

Closing for now as this does not seems to be an issue with Flutter.

@harsimranmaan
Copy link
Author

harsimranmaan commented Dec 15, 2020

@pedromassangocode I think you might have missed the point. The issue here is that create does not work on an app when flavors are already defined. See the first execution without flavors, it fails. The second one fails because create does not support flavors. I could not find a workaround other than manually creating the web files.

@pedromassangocode
Copy link

Hi @harsimranmaan
Can you please provide a complete sample project that does not uses third-party plugins/packages?
Thank you

@pedromassangocode pedromassangocode added in triage Presently being triaged by the triage team waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds labels Dec 16, 2020
@harsimranmaan
Copy link
Author

I tried this on the dev channel and was able to use the create app to instantiate a windows app in the same repo. This might be a resolved issue in the newer flutter versions. I'll try to create a minimal sample project to repro

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Dec 24, 2020
@pedromassangocode pedromassangocode added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Dec 28, 2020
@pedromassangocode
Copy link

Without additional information, we are unfortunately not sure how to resolve this issue.
We are therefore reluctantly going to close this bug for now.
Please don't hesitate to comment on the bug if you have any more information for us; we will reopen it right away!
Thanks for your contribution.

Could everyone who still has this problem please file a new issue with the exact description of what happens, logs, and the output of flutter doctor -v.
All system setups can be slightly different, so it's always better to open new issues and reference related issues.

@pedromassangocode pedromassangocode removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 20, 2021
@Prayer-RecycleSmart
Copy link

Hi, having same issue.
Project with simple two flavors dev and prod with several packages.

when i run flutter create -v --platforms web . it crashes. Here's the logs

[  +80 ms] executing: [/Users/mprayergalletti/Library/flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[  +42 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[   +3 ms] 5d36f2e7f5387b6c751449258ade8e4e6edf99be
[   +1 ms] executing: [/Users/mprayergalletti/Library/flutter/] git tag --points-at 5d36f2e7f5387b6c751449258ade8e4e6edf99be
[  +26 ms] Exit code 0 from: git tag --points-at 5d36f2e7f5387b6c751449258ade8e4e6edf99be
[        ] 1.25.0-8.3.pre
[  +68 ms] executing: [/Users/mprayergalletti/Library/flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[  +12 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] origin/beta
[        ] executing: [/Users/mprayergalletti/Library/flutter/] git ls-remote --get-url origin
[  +14 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[  +72 ms] executing: [/Users/mprayergalletti/Library/flutter/] git rev-parse --abbrev-ref HEAD
[  +11 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] beta
[   +6 ms] executing: sw_vers -productName
[  +24 ms] Exit code 0 from: sw_vers -productName
[        ] Mac OS X
[        ] executing: sw_vers -productVersion
[  +20 ms] Exit code 0 from: sw_vers -productVersion
[        ] 10.15.7
[        ] executing: sw_vers -buildVersion
[  +28 ms] Exit code 0 from: sw_vers -buildVersion
[        ] 19H512
[   +9 ms] executing: sysctl hw.optional.arm64
[   +7 ms] Exit code 1 from: sysctl hw.optional.arm64
[   +1 ms] sysctl: unknown oid 'hw.optional.arm64'
[  +67 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +3 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[  +54 ms] Artifact Instance of 'MaterialFonts' is not required, skipping update.
[        ] Artifact Instance of 'GradleWrapper' is not required, skipping update.
[        ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[        ] Artifact Instance of 'FlutterSdk' is not required, skipping update.
[        ] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'PubDependencies' is not required, skipping update.
[  +81 ms] executing: /usr/bin/plutil -convert json -o - /Users/mprayergalletti/develop/flutter/recyclesmart/./ios/Runner/Info.plist
[  +13 ms] Exit code 0 from: /usr/bin/plutil -convert json -o - /Users/mprayergalletti/develop/flutter/recyclesmart/./ios/Runner/Info.plist
[        ]
{"CFBundleName":"RecycleSmart","UILaunchStoryboardName":"LaunchScreen","CFBundleDevelopmentRegion":"$(DEVELOPMENT_LANGUAGE)","CFBundleVersion":"$(CURRENT_PROJECT_VERSION)","UIBackgr
oundModes":["fetch","remote-notification"],"NSCameraUsageDescription":"Use the camera to provide an image of the issue you have
encountered.","io.flutter.embedded_views_preview":"true","CFBundlePackageType":"APPL","UIMainStoryboardFile":"Main","CFBundleShortVersionString":"$(MARKETING_VERSION)","CFBundleInfo
DictionaryVersion":"6.0","CFBundleExecutable":"$(EXECUTABLE_NAME)","UISupportedInterfaceOrientations~ipad":["UIInterfaceOrientationPortrait","UIInterfaceOrientationPortraitUpsideDow
n","UIInterfaceOrientationLandscapeLeft","UIInterfaceOrientationLandscapeRight"],"UIViewControllerBasedStatusBarAppearance":false,"CFBundleIdentifier":"$(PRODUCT_BUNDLE_IDENTIFIER)"
,"CFBundleSignature":"????","LSRequiresIPhoneOS":true,"CFBundleDisplayName":"$(APP_DISPLAY_NAME)","NSLocationAlwaysUsageDescription":"We would like to use your location to determine
the closest recycling facilities to you","UISupportedInterfaceOrientations":["UIInterfaceOrientationPortrait"],"NSPhotoLibraryUsageDescription":"Use the camera to provide an image
of the issue you have encountered.","NSLocationWhenInUseUsageDescription":"We would like to use your location to determine the closest recycling facilities to you"}
[  +17 ms] executing: sysctl hw.optional.arm64
[   +4 ms] Exit code 1 from: sysctl hw.optional.arm64
[        ] sysctl: unknown oid 'hw.optional.arm64'
[        ] executing: xcrun xcodebuild -version
[ +213 ms] Exit code 0 from: xcrun xcodebuild -version
[   +1 ms] Xcode 12.3
           Build version 12C33
[   +4 ms] executing: [./ios/] xcrun xcodebuild -list
[+1793 ms] Command line invocation:
                        /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -list

                    Information about project "Runner":
                        Targets:
                            Runner

                        Build Configurations:
                            Debug-prod
                            Debug-dev
                            Release-prod
                            Release-dev
                            Profile-prod
                            Profile-dev

                        If no build configuration is specified and -scheme is not passed then "Release-prod" is used.

                        Schemes:
                            dev
                            prod
[   +2 ms] The Xcode project defines schemes: dev, prod
[  +17 ms] "flutter create" took 2,226ms.
[   +5 ms] You must specify a --flavor option to select one of the available schemes.
[        ]
           #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
           #1      XcodeProjectInfo.reportFlavorNotFoundAndExit (package:flutter_tools/src/ios/xcodeproj.dart:552:7)
           #2      IosProject.buildSettingsForBuildInfo (package:flutter_tools/src/project.dart:554:12)
           <asynchronous suspension>
           #3      IosProject._parseProductBundleIdentifier (package:flutter_tools/src/project.dart:489:50)
           <asynchronous suspension>
           #4      IosProject.productBundleIdentifier (package:flutter_tools/src/project.dart:466:41)
           <asynchronous suspension>
           #5      FlutterProject.organizationNames (package:flutter_tools/src/project.dart:109:9)
           <asynchronous suspension>
           #6      CreateBase.getOrganization (package:flutter_tools/src/commands/create_base.dart:234:49)
           <asynchronous suspension>
           #7      CreateCommand.runCommand (package:flutter_tools/src/commands/create.dart:212:33)
           <asynchronous suspension>
           #8      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:1134:12)
           <asynchronous suspension>
           #9      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:986:27)
           <asynchronous suspension>
           #10     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #11     AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
           <asynchronous suspension>
           #12     CommandRunner.runCommand (package:args/command_runner.dart:197:13)
           <asynchronous suspension>
           #13     FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:274:9)
           <asynchronous suspension>
           #14     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #15     AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
           <asynchronous suspension>
           #16     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:230:5)
           <asynchronous suspension>
           #17     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:63:9)
           <asynchronous suspension>
           #18     run.<anonymous closure> (package:flutter_tools/runner.dart:61:12)
           <asynchronous suspension>
           #19     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #20     AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
           <asynchronous suspension>
           #21     runInContext (package:flutter_tools/src/context_runner.dart:70:10)
           <asynchronous suspension>
           #22     main (package:flutter_tools/executable.dart:88:3)
           <asynchronous suspension>


[ +254 ms] ensureAnalyticsSent: 252ms
[   +1 ms] Running shutdown hooks
[        ] Shutdown hooks complete
[        ] exiting with code 1 ```

@rymesaint
Copy link

i got this error too

@pedromassangocode
Copy link

Could everyone who still has this problem please file a new issue with the exact description of what happens, logs, and the output of flutter doctor -v.
All system setups can be slightly different, so it's always better to open new issues and reference related issues.

@joelbrostrom
Copy link

joelbrostrom commented Mar 25, 2021

I got this error as well.
Without flavor it tells me I need to include flavor.
With flavor it tells me flavor is not a valid option.

flutter create -v .

output
$ flutter create -v .
[ +114 ms] executing: [/Users/joelbrostrom/Library/flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[  +94 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[   +2 ms] c5a4b4029c0798f37c4a39b479d7cb75daa7b05c
[        ] executing: [/Users/joelbrostrom/Library/flutter/] git tag --points-at c5a4b4029c0798f37c4a39b479d7cb75daa7b05c
[ +799 ms] Exit code 0 from: git tag --points-at c5a4b4029c0798f37c4a39b479d7cb75daa7b05c
[        ] 2.0.1
[  +79 ms] executing: [/Users/joelbrostrom/Library/flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[  +19 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] origin/stable
[        ] executing: [/Users/joelbrostrom/Library/flutter/] git ls-remote --get-url origin
[  +34 ms] Exit code 0 from: git ls-remote --get-url origin
[   +1 ms] https://github.com/flutter/flutter.git
[ +133 ms] executing: [/Users/joelbrostrom/Library/flutter/] git rev-parse --abbrev-ref HEAD
[  +43 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[   +1 ms] stable
[  +91 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +3 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +134 ms] Artifact Instance of 'MaterialFonts' is not required, skipping update.
[        ] Artifact Instance of 'GradleWrapper' is not required, skipping update.
[        ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[        ] Artifact Instance of 'FlutterSdk' is not required, skipping update.
[        ] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[   +4 ms] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'PubDependencies' is not required, skipping update.
[  +96 ms] executing: /usr/bin/plutil -convert json -o - /Users/joelbrostrom/Repos/ana-app-flutter/./ios/Runner/Info.plist
[  +11 ms] Exit code 0 from: /usr/bin/plutil -convert json -o - /Users/joelbrostrom/Repos/ana-app-flutter/./ios/Runner/Info.plist
[        ]
{"CFBundleShortVersionString":"$(FLUTTER_BUILD_NAME)","CFBundleIdentifier":"$(PRODUCT_BUNDLE_IDENTIFIER)","CFBundleInfoDictionaryVersion":"6.0","UIMai
nStoryboardFile":"Main","CFBundleVersion":"$(FLUTTER_BUILD_NUMBER)","UILaunchStoryboardName":"LaunchScreen","CFBundleExecutable":"$(EXECUTABLE_NAME)",
"LSRequiresIPhoneOS":true,"UISupportedInterfaceOrientations":["UIInterfaceOrientationPortrait"],"CFBundleDisplayName":"$(APP_DISPLAY_NAME)","CFBundleL
ocalizations":["en","Swedish"],"UIViewControllerBasedStatusBarAppearance":true,"CFBundleSignature":"????","CFBundlePackageType":"APPL","CFBundleDevelo
pmentRegion":"$(DEVELOPMENT_LANGUAGE)","UISupportedInterfaceOrientations~ipad":["UIInterfaceOrientationPortrait","UIInterfaceOrientationPortraitUpside
Down","UIInterfaceOrientationLandscapeLeft","UIInterfaceOrientationLandscapeRight"],"CFBundleName":"My Negotiator"}
[  +19 ms] executing: sysctl hw.optional.arm64
[   +5 ms] Exit code 1 from: sysctl hw.optional.arm64
[        ] sysctl: unknown oid 'hw.optional.arm64'
[        ] executing: xcrun xcodebuild -version
[+1338 ms] Exit code 0 from: xcrun xcodebuild -version
[        ] Xcode 12.4
           Build version 12D4e
[   +4 ms] executing: [./ios/] xcrun xcodebuild -list
[+3542 ms] Command line invocation:
                        /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -list

                    Information about project "Runner":
                        Targets:
                            Runner

                        Build Configurations:
                            Debug-priv
                            Debug-comp
                            Release-priv
                            Release-comp
                            Profile-priv
                            Profile-comp

                        If no build configuration is specified and -scheme is not passed then "Release-priv" is used.

                        Schemes:
                            comp
                            priv
[   +3 ms] The Xcode project defines schemes: comp, priv
[  +20 ms] "flutter create" took 5,207ms.
[   +9 ms] You must specify a --flavor option to select one of the available schemes.
[        ] 
           #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
           #1      XcodeProjectInfo.reportFlavorNotFoundAndExit (package:flutter_tools/src/ios/xcodeproj.dart:555:7)
           #2      IosProject.buildSettingsForBuildInfo (package:flutter_tools/src/project.dart:574:12)
           <asynchronous suspension>
           #3      IosProject._parseProductBundleIdentifier (package:flutter_tools/src/project.dart:509:50)
           <asynchronous suspension>
           #4      IosProject.productBundleIdentifier (package:flutter_tools/src/project.dart:486:41)
           <asynchronous suspension>
           #5      FlutterProject.organizationNames (package:flutter_tools/src/project.dart:109:9)
           <asynchronous suspension>
           #6      CreateBase.getOrganization (package:flutter_tools/src/commands/create_base.dart:234:49)
           <asynchronous suspension>
           #7      CreateCommand.runCommand (package:flutter_tools/src/commands/create.dart:212:33)
           <asynchronous suspension>
           #8      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:1157:12)
           <asynchronous suspension>
           #9      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1009:27)
           <asynchronous suspension>
           #10     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #11     AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
           <asynchronous suspension>
           #12     CommandRunner.runCommand (package:args/command_runner.dart:197:13)
           <asynchronous suspension>
           #13     FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:278:9)
           <asynchronous suspension>
           #14     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #15     AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
           <asynchronous suspension>
           #16     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:234:5)
           <asynchronous suspension>
           #17     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:64:9)
           <asynchronous suspension>
           #18     run.<anonymous closure> (package:flutter_tools/runner.dart:62:12)
           <asynchronous suspension>
           #19     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #20     AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
           <asynchronous suspension>
           #21     runInContext (package:flutter_tools/src/context_runner.dart:73:10)
           <asynchronous suspension>
           #22     main (package:flutter_tools/executable.dart:90:3)
           <asynchronous suspension>
           
           
[  +43 ms] ensureAnalyticsSent: 1ms
[  +19 ms] Running shutdown hooks
[        ] Shutdown hooks complete
[        ] exiting with code 1

flutter create -v --flavor=comp .

output
$ flutter create -v --flavor=comp .
[  +92 ms] executing: [/Users/joelbrostrom/Library/flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[  +57 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[   +3 ms] c5a4b4029c0798f37c4a39b479d7cb75daa7b05c
[   +1 ms] executing: [/Users/joelbrostrom/Library/flutter/] git tag --points-at c5a4b4029c0798f37c4a39b479d7cb75daa7b05c
[  +62 ms] Exit code 0 from: git tag --points-at c5a4b4029c0798f37c4a39b479d7cb75daa7b05c
[        ] 2.0.1
[  +60 ms] Could not find an option named "flavor".
           
[   +4 ms] Run 'flutter -h' (or 'flutter <command> -h') for available flutter commands and options.
[   +4 ms] executing: [/Users/joelbrostrom/Library/flutter/] git rev-parse --abbrev-ref HEAD
[  +19 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] stable
[  +28 ms] ensureAnalyticsSent: 1ms
[   +3 ms] Running shutdown hooks
[        ] Shutdown hooks complete
[   +7 ms] exiting with code 64

flutter doctor -v

output
$ flutter doctor -v
[✓] Flutter (Channel stable, 2.0.1, on macOS 11.2.3 20D91 darwin-x64, locale en-SE)
    • Flutter version 2.0.1 at /Users/joelbrostrom/Library/flutter
    • Framework revision c5a4b4029c (3 weeks ago), 2021-03-04 09:47:48 -0800
    • Engine revision 40441def69
    • Dart version 2.12.0

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/joelbrostrom/Library/Android/sdk
    • Platform android-30, build-tools 30.0.2
    • ANDROID_HOME = /Users/joelbrostrom/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.4, Build version 12D4e
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 51.0.1
    • Dart plugin version 193.7547
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] VS Code (version 1.54.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.20.0

[✓] Connected device (2 available)
    • SM G950F (mobile) • 988a16355332374847 • android-arm64  • Android 9 (API 28)
    • Chrome (web)      • chrome             • web-javascript • Google Chrome 89.0.4389.90

I just want to see if I can build my app for web, but to do that I need to rebuild it.

@SeanZom
Copy link

SeanZom commented Mar 26, 2021

Same here.
I have multiple flavors of build, tried to run flutter create . and got:

The Xcode project defines schemes: dev, prod, staging
You must specify a --flavor option to select one of the available schemes.

@tamoyal
Copy link

tamoyal commented Apr 13, 2021

Same issue as @SeanZom

@mateusfccp
Copy link
Contributor

This happened to me when trying to enable desktop on an already existing project with flutter create .. The error said that I should use --flavor even if flutter create has no --flavor option.

@tamoyal
Copy link

tamoyal commented Apr 24, 2021

Anyone have a solution to this yet?

@long1eu
Copy link

long1eu commented Apr 27, 2021

@pedromassango why is this issue closed?

@pedromassangocode
Copy link

@long1eu see #72329 (comment)

@long1eu
Copy link

long1eu commented Apr 27, 2021

@pedromassango I'm sorry, maybe I'm mistaken, but it seems to me that you completely ignored the issue description and you hurried to close this. Can you be more specific on what additional information you need? To me this is pretty clear and I can reproduces it in any of my projects.

@long1eu
Copy link

long1eu commented Apr 27, 2021

The workarround for this is no move/remane the ios folder.

mv ios _ios
flutter create --platforms macos .
mv _ios ios

@pedromassangocode
Copy link

Sorry about that!

@pedromassangocode pedromassangocode added passed first triage c: crash Stack traces logged to the console tool Affects the "flutter" command-line tool. See also t: labels. and removed in triage Presently being triaged by the triage team labels Apr 27, 2021
@asashour
Copy link
Contributor

I am trying to create a project with old flutter, to have flavors, but I couldn't.

As hinted here, using the command

flutter build --flavor development

With the Channel stable, v1.12.13+hotfix.9

Could not find an option named "flavor".

Is there any public repository which has flavors?

@saifbak
Copy link

saifbak commented Sep 21, 2021

I had try these, and it's worked for me

flutter run --flavor dev or flutter run --flavor prod

@andressignes
Copy link

I solved running create command with org option
flutter create --org <identifier-for-one-of-the-flavors> --platforms=macos .

@irwan75
Copy link

irwan75 commented Mar 2, 2022

make sure you define the flavor name on xcode and in launch.json (if you using VSCode) is equals

@Josecodesalot
Copy link

Ah just when I wanted to generate an index.html following flutter 3 release

@komritza
Copy link

I solved running create command with org option flutter create --org <identifier-for-one-of-the-flavors> --platforms=macos .

Thanks a lot mate! Worked like a charm!

@sab99r
Copy link

sab99r commented Dec 9, 2022

@andressignes solution works fine for me. before running the flutter create --org <identifier-for-one-of-the-flavors> command make sure your project folder name follows flutter naming standards. It should be in small letter and if you need name separation only _ is allowed

@flutter-triage-bot flutter-triage-bot bot added the team-tool Owned by Flutter Tool team label Jul 8, 2023
@christopherfujino christopherfujino added P2 Important issues not at the top of the work list triaged-tool Triaged by Flutter Tool team labels Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: crash Stack traces logged to the console P2 Important issues not at the top of the work list team-tool Owned by Flutter Tool team tool Affects the "flutter" command-line tool. See also t: labels. triaged-tool Triaged by Flutter Tool team
Projects
None yet
Development

No branches or pull requests