-1

When creating a new Flutter plugin template from the command line using flutter create, if you do not specify any platforms, the default is (as of now), that no platforms are included.

What is the actual verbatim command you would type in order to include ios and android platforms?

I have read the docs, the help file, which states:

--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)]

... several tutorials specific to the flutter command, and this general tutorial, but none of them explain or show this evasive nugget of truth. The fact that the help file is confusing is acknowledged in this github issue, but nobody in the thread happens to describe the correct command.

Commands I have tried:

flutter create -t plugin --platforms ios android my_plugin

flutter create -t plugin --platforms [ios, android] my_plugin

flutter create -t plugin --platforms=[ios,android] my_plugin

flutter create -t plugin --platforms ["ios","android"] my_plugin

flutter create -t plugin --platforms=["ios","android"] my_plugin

flutter create -t plugin --platforms "ios" "android" my_plugin

Nerdy Bunz
  • 6,040
  • 10
  • 41
  • 100

1 Answers1

1

Have you tried this

flutter create --org com.example --template=plugin --platforms=android,ios,linux,macos,windows -i swift hello

Important factors EDIT by OP:

  • the equals signs are optional
  • do not use spaces like "android , ios" or "android, ios"
  • do not use brackets
Nerdy Bunz
  • 6,040
  • 10
  • 41
  • 100