Flutter web create issue in existing flutter app

16,674

Solution 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

Solution 2

You can use this command

flutter create --org package_name .

Solution 3

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

Solution 4

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.

Solution 5

You jus add following line

flutter create --org FLUTTER_APP .
Share:
16,674
Rahul Devanavar
Author by

Rahul Devanavar

Android enthusiast. Love Coding

Updated on December 14, 2022

Comments

  • Rahul Devanavar
    Rahul Devanavar over 1 year

    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
    
    • Jigar Fumakiya
      Jigar Fumakiya over 4 years
      check android & IOS package name
    • Rahul Devanavar
      Rahul Devanavar over 4 years
      If I trying to change that it's not working
    • Jigar Fumakiya
      Jigar Fumakiya over 4 years
      change android package name from manifest and IOS package name from Xcode
    • Al Mamun
      Al Mamun about 3 years
      I just change my ios bunddle id same as android package name and it works
  • Abdullah Khan
    Abdullah Khan almost 4 years
    Then what the doc mean here flutter.dev/docs/get-started/…
  • tensor
    tensor almost 4 years
    I added support to existing project, please have a look at my answer and try that out :)
  • Saw Thinkar Nay Htoo
    Saw Thinkar Nay Htoo over 3 years
    What does the above command do? Why doesn't flutter create . work?
  • Yogesh Patel
    Yogesh Patel over 3 years
    Hello Harshit, I follow your steps facing one error please help! No devices found with name or id matching 'chrome'
  • Jai Techie
    Jai Techie almost 3 years
    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.
  • Abdulrahman Alhayek
    Abdulrahman Alhayek over 2 years
    When I use this command with an existing project I get the following error: "App_Flutter" is not a valid Dart package name. Please note I'm trying to add a macOS version @SawThinkarNayHtoo