How do I create a flutter project despite the error "At least one platform must be selected"?

966

Solution 1

Just the temporary solution create project with cmd

flutter create my_app

must have flutter environment set in your OS. Then open with intellij project by browse my_app directory.

Solution 2

Problem is with 53.0 version of Flutter plugin for IntelliJ. You need to install previous version.

  1. Download Flutter plugin from this link (https://plugins.jetbrains.com/plugin/download?rel=true&updateId=107561)
  2. Open IntelliJ
  3. Go to Settings
  4. Click on Plugins
  5. Click on Settings icon at the right corner of navbar
  6. Click "Install Plugin from Disk..."
  7. Select .zip file of Flutter plugin you just downloaded
  8. Restart IDE

This works for me, hope this will solve your problem.

Solution 3

Known issue (caused by flutter/devtools#2653), please see https://github.com/flutter/flutter-intellij/issues/5230#issuecomment-771279236 for a workaround

Share:
966
Nikko
Author by

Nikko

Updated on December 27, 2022

Comments

  • Nikko
    Nikko over 1 year

    I'm trying to create a new Flutter project in IntelliJ and I get the error "At least one platform must be selected"

    I followed the instructions from the Flutter website: ( here and here) However when I click on 'Finish' I receive the error shown and in the specified place just an empty folder is created.

    Example from start to end:

    • Install the Flutter and Dart plugins from the IntelliJ marketplace

    • Click on "Create New Project" and choose Flutter from the list on the left

    • Flutter SDK path is prefilled to /home/nikko/snap/flutter/common/flutter (see note on flutter), so I click Next

    • set name: tryseven, location: ~/Folders/Me/Programming/Mobile/Flutter/tryseven,

      • type: Application,
      • organization: com.example
      • android language: Java
      • iOS language: Swift
      • create project offline: False
    • the "More settings" tab wasn't changed, default project format is .idea (directory based)

    • Click finish and I get the error. When I go to ~/Folders/Me/Programming/Mobile/Flutter/tryseven the directory is created and is empty

    Notes:

    flutter --version returns

    Flutter 1.22.6 • channel stable • https://github.com/flutter/flutter.git
    Framework • revision 9b2d32b605 (11 days ago) • 2021-01-22 14:36:39 -0800
    Engine • revision 2f0af37152
    Tools • Dart 2.10.5
    

    and if I change the "Flutter SDK path" to something else I get the warning "Flutter SDK is not found in the specified location." So Flutter should be set correctly


    using Ubuntu 20.04.1 LTS 64-bit

    and IntelliJ IDEA v.2020.1.4

    IntelliJ doesn't open after I close it, I need to kill the process first, even though the window is closed. Not sure if that impacts in any way, but I'll reinstall the IDE


    What I've tried without success:

    • changing the language to Kotlin or C
    • changing the organization to test.org
    • changing the type to Package (language and organization selection are disabled)
    • changing "Create project offline" to True
  • Nikko
    Nikko about 3 years
    Hello lena, after removing the new version and putting 52.2.5 I get the error "Incompatible (since build 203.5981.155 > IU-201.8743.12)" and I no longer have the option to create a Flutter project in the menu
  • Nikko
    Nikko about 3 years
    What version of IntelliJ are you using? When I follow these steps exactly I get the error "Plugin 'Flutter' is incompatible with this installation"
  • Ben Jie Ming
    Ben Jie Ming about 3 years
    I use IntelliJ Ultimate, and plugin I posted is compatible with that version. Click here (plugins.jetbrains.com/plugin/9212-flutter/versions ) and download plugin for Community version (you have to choose version 52.2.3 or 52.2.5).
  • Nikko
    Nikko about 3 years
    I am also using IntelliJ Ultimate - IntelliJ IDEA 2020.1.4 (Ultimate Edition) Build #IU-201.8743.12, built on July 21, 2020 Non-Bundled Plugins: CheckStyle-IDEA, app.teamhub, Dart Current Desktop: ubuntu:GNOME
  • Nikko
    Nikko about 3 years
    This is the only answer that actually allows me to create a project. It's not through the plugin which makes it more difficult to use, but it works