32

I already have the flutter app, now I am adding support to flutter Web following this doc. I am getting the error on flutter create .

Ambiguous organization in existing files: {com.app.android.fluttermodule,com.app.android.flutterModule}. The --org command line argument must be
specified to recreate project.

I have mentioned pubsec.yml

  module:
    androidPackage: com.app.android.fluttermodule
    iosBundleIdentifier: com.app.android.flutterModule
Rahul Devanavar
  • 3,917
  • 4
  • 32
  • 61

8 Answers8

71

You can use this command

flutter create --org package_name .
Rahul Devanavar
  • 3,917
  • 4
  • 32
  • 61
kokoko
  • 711
  • 4
  • 3
9

You can add the app to the existing flutter project as well. Here are some steps that I followed

1: Create a new branch to not mess things up in existing branch if you are starting with flutter web for the first time.

2: flutter channel master

3: flutter config --enable-web: Now you may or may not see the new Dart SDK being downloaded.

4: flutter create --org package_name .: This will add the web files in your project.

5: flutter devices: You must see chrome listed now.

6: flutter run -d chrome: If you see something like project not configured for the web then try step 3 again and reopen your editor.

tensor
  • 733
  • 1
  • 13
  • 22
  • Hello Harshit, I follow your steps facing one error please help! No devices found with name or id matching 'chrome' – Yogesh Patel Jan 09 '21 at 15:12
  • hello, flutter create --org package_name . in this step if i entered correct package name also is not a valid Dart package name error showing. – Jai Techie May 21 '21 at 08:59
6

this worked for me. you need to specify output directory too. for the same flutterapp directory, use ./ hope this helps u :)

flutter create --org flutterappname ./
yuxcat
  • 61
  • 1
  • 3
3

Here is what I did for an existing project.

Step 1: Create a new folder named web_project or something in the existing project folder.

Step 2: Go to this folder in the terminal

Step 3: Run flutter create --platforms web --org com.example.flutter .

This step will create a new flutter project with a web folder in it

Step 4: Cut and paste the web folder in your existing project folder and delete the new project which in my case was web_project

Step 5: Run the project and you will see Chrome as a device in the devices menu

FYI: This is done on Flutter 2.2.0

Hope this will help you to add web support to your flutter project

Saheb Singh
  • 1,172
  • 7
  • 13
2

You jus add following line

flutter create --org FLUTTER_APP .
gsm
  • 2,348
  • 17
  • 16
1

I am getting this issue because of creating flutter web apps from existing flutter Android and iOS codebase,for this structure flutter web is not supported... We have to create a new flutter project for web

Rahul Devanavar
  • 3,917
  • 4
  • 32
  • 61
1

we don't have to create a new project, we just need to pass the specific organization name.

 e.g: flutter create --org <<domain_keyword>> .

this happens because, during new project creation, we leave the domain as IDE suggested. which is "com.example.project_name" and during sign application, we need to change the domain and almost everyone change it.

1

Ambiguous organization in existing files: {com.app.android.fluttermodule,com.app.android.flutterModule}. The --org command line argument must be specified to recreate project.

It means there's different package names.

com.app.android.fluttermodule
com.app.android.flutterModule

One or some of your names contain lowercase m in ..android.fluttermodule and some uppercase M. Rename all to be the same and run flutter create . again.

Tipper
  • 11
  • 1