Creating plugin, missing ios & android directory?

It’s very weird that however I create a plugin, either by command line or Android Studio’s wizard, the ios and android directory are missing in the structure.

The command line I use is:
flutter create --template = plugin -i swift -a java my_plugin_name

I think I am on the latest stable flutter and android studio. I’ve looked up google and can’t find anyone else mentioning the same issue. Please help me, and let me know what I can do to get the plugin start up properly. Really really thank you.

My flutter doctor runs as:
C:\flutter\bin\flutter.bat doctor --verbose
[√] Flutter (Channel stable, 1.20.2, on Microsoft Windows [Version 10.0.18363.1016], locale en-US)
• Flutter version 1.20.2 at C:\flutter
• Framework revision bbfbf1770c (3 weeks ago), 2020-08-13 08:33:09 -0700
• Engine revision 9d5b21729f
• Dart version 2.9.1

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.0-rc2)
• Android SDK at C:\Users\myusername\AppData\Local\Android\sdk
• Platform android-30, build-tools 30.0.0-rc2
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
• All Android licenses accepted.

[√] Android Studio (version 4.0)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 48.1.2
• Dart plugin version 193.7547
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] Connected device (1 available)
• AOSP on IA Emulator (mobile) • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)

• No issues found!
Process finished with exit code 0

alright, found the answer myself, and in case anyone else running into the same problem. Here’s the new command:

flutter create --template=plugin --platforms=android,ios -i swift -a java my_plugin_name123

actually, it’s stated in the latest document that since Flutter 1.20.0, the platforms argument must be specified in order to create the directories.


Thanks for posting the answer! I am sure it will help others. <3