Search code examples
flutterdesktop-applicationflutter-desktopflutter-windows

Unable to create desktop application support from existing project in flutter


I am creating a desktop application from an existing app. The command given in documentation is :

flutter create .

Running this command in the root of the project directory I am getting this error

"MyApp" is not a valid Dart package name.

Note: MyApp is name of my project


Solution

  • Flutter only allows project names that are lower case letters and may contain an underscore or a number. This is actually a convention from dart packages. Check here for the prescribed convention. It is likely that your folder name is used by flutter as its project name. You can try to overcome this by changing the folder name. But please do keep a backup before doing flutter create on an existing project. For more details on possible options check this post as well.