flutter icon indicating copy to clipboard operation
flutter copied to clipboard

flutter create fails when using flavors

Open harsimranmaan opened this issue 5 years ago • 27 comments

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 avatar Dec 15 '20 03:12 harsimranmaan

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

harsimranmaan avatar Dec 15 '20 03:12 harsimranmaan

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.

pedromassangocode avatar Dec 15 '20 10:12 pedromassangocode

@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.

harsimranmaan avatar Dec 15 '20 14:12 harsimranmaan

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

pedromassangocode avatar Dec 16 '20 09:12 pedromassangocode

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

harsimranmaan avatar Dec 24 '20 07:12 harsimranmaan

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 avatar Jan 20 '21 10:01 pedromassangocode

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 ```

Prayer-RecycleSmart avatar Feb 04 '21 08:02 Prayer-RecycleSmart

i got this error too

rymesaint avatar Mar 04 '21 12:03 rymesaint

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 avatar Mar 04 '21 13:03 pedromassangocode

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.

joelbrostrom avatar Mar 25 '21 13:03 joelbrostrom

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.

SeanZom avatar Mar 26 '21 13:03 SeanZom

Same issue as @SeanZom

tamoyal avatar Apr 13 '21 04:04 tamoyal

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.

mateusfccp avatar Apr 13 '21 22:04 mateusfccp

Anyone have a solution to this yet?

tamoyal avatar Apr 24 '21 19:04 tamoyal

@pedromassango why is this issue closed?

long1eu avatar Apr 27 '21 05:04 long1eu

@long1eu see https://github.com/flutter/flutter/issues/72329#issuecomment-763521565

pedromassangocode avatar Apr 27 '21 08:04 pedromassangocode

@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 avatar Apr 27 '21 09:04 long1eu

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

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

long1eu avatar Apr 27 '21 09:04 long1eu

Sorry about that!

pedromassangocode avatar Apr 27 '21 10:04 pedromassangocode

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?

asashour avatar Jun 22 '21 08:06 asashour

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

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

saifbak avatar Sep 21 '21 11:09 saifbak

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

andreuSignes avatar Feb 17 '22 17:02 andreuSignes

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

irwan75 avatar Mar 02 '22 07:03 irwan75

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

Josecodesalot avatar May 12 '22 01:05 Josecodesalot

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!

komritza avatar Aug 17 '22 08:08 komritza

@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

sab99r avatar Dec 09 '22 08:12 sab99r

Could someone who has used the latest stable versions of Flutter comment if this is still an issue?

matanlurey avatar May 23 '25 20:05 matanlurey

Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. If you find this problem please file a new issue with the same description, 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 the related ones. Thanks for your contribution.

github-actions[bot] avatar Jun 13 '25 21:06 github-actions[bot]

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.

github-actions[bot] avatar Jun 27 '25 22:06 github-actions[bot]