-
Notifications
You must be signed in to change notification settings - Fork 27.1k
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
Comments
The app flavor setup can be found in https://github.com/bigpanther/shipanther. Relates bigpanther/shipanther#168 |
Hi @harsimranmaan for what I know the flutter create -hMacBook-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 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. |
Hi @harsimranmaan |
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 |
Without additional information, we are unfortunately not sure how to resolve this issue. Could everyone who still has this problem please file a new issue with the exact description of what happens, logs, and the output of |
Hi, having same issue. when i run
|
i got this error too |
|
I got this error as well.
output
output
output
I just want to see if I can build my app for web, but to do that I need to rebuild it. |
Same here.
|
Same issue as @SeanZom |
This happened to me when trying to enable desktop on an already existing project with |
Anyone have a solution to this yet? |
@pedromassango why is this issue closed? |
@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. |
The workarround for this is no move/remane the ios folder. mv ios _ios
flutter create --platforms macos .
mv _ios ios |
Sorry about that! |
I am trying to create a project with old flutter, to have flavors, but I couldn't. As hinted here, using the command
With the
Is there any public repository which has flavors? |
I had try these, and it's worked for me flutter run --flavor dev or flutter run --flavor prod |
I solved running create command with org option |
make sure you define the flavor name on xcode and in launch.json (if you using VSCode) is equals |
Ah just when I wanted to generate an index.html following flutter 3 release |
Thanks a lot mate! Worked like a charm! |
@andressignes solution works fine for me. before running the |
Steps to Reproduce
flutter create .
as listed in https://flutter.dev/docs/get-started/web#add-web-support-to-an-existing-appLogs
The text was updated successfully, but these errors were encountered: