Skip to content

Auto-select the flutter generator when invoking the new project wizard from the "New Flutter Project..." action #8210

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
csells opened this issue May 21, 2025 · 7 comments

Comments

@csells
Copy link

csells commented May 21, 2025

I downloaded the latest version of Android Studio so I could play with the Gemini integration, but every time I try to generate a new Flutter project, I get something like this:

Image

Android Studio version:

Android Studio Meerkat Feature Drop | 2024.3.2
Build #AI-243.25659.59.2432.13423653, built on April 29, 2025
Runtime version: 21.0.6+-13368085-b895.109 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.lwawt.macosx.LWCToolkit
macOS 15.4.1
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 4096M
Cores: 12
Metal Rendering is ON
Registry:
  ide.experimental.ui=true
Non-Bundled Plugins:
  Dart (243.26753.1)
  io.flutter (85.3.1)

Flutter plug-in version: 85.3.1
Dart plug-in version: 243.26753.1

@pq
Copy link
Contributor

pq commented May 21, 2025

Thanks Chris!

I took a quick crack at a repro and had no luck.

Here's what I had checked in the project creation wizard:

Image

and the result:

Image

What does your new project wizard content look like?

@mit-mit
Copy link
Member

mit-mit commented May 22, 2025

I wonder if this is a gradle issue based on the first screenshot? @csells in a terminal are you able to flutter create foobar & flutter build apk ?

@csells
Copy link
Author

csells commented May 23, 2025

@mit-mit No problem with flutter create foobar & cd foobar & flutter build apk as shown here:

Image

@github-actions github-actions bot removed the waiting for customer response Auto-close if no response label May 23, 2025
@csells
Copy link
Author

csells commented May 23, 2025

@pq here's that video I promised. Let me know if there are some log files I can dig up for you or something. I'm on the latest version of AS, the Flutter + Dart extensions to AS and Flutter stable.

Screen.Recording.2025-05-22.at.6.43.22.PM.mov

@pq
Copy link
Contributor

pq commented May 23, 2025

Hey Chris!

Watching your video at around 0:10, it looks like the project type selected when you invoke the "New Flutter Project..." action is actually Kotlin (which appears to mean vanilla Kotlin and not, as you might expect, a Flutter android project that uses Kotlin).

Image

I see a similar default selection when I invoke "New Flutter Project..." but when I manually select "Flutter" from the generator list,

all works as expected.


Implementation aside: digging into FlutterNewProjectAction we're just creating a NewProjectWizard so this is WAI:

  public void actionPerformed(@NotNull AnActionEvent e) {
    if (FlutterUtils.isAndroidStudio()) {
      System.setProperty("studio.projectview", "true");
    }
    NewProjectWizard wizard = new NewProjectWizard(null, ModulesProvider.EMPTY_MODULES_PROVIDER, null);
    NewProjectUtil.createNewProject(wizard);
  }

I do have to wonder if there isn't some way to select the Flutter generator our of the gate though (since that seems to be what folks would expect)?


Thanks for the video, Chris! Let me know if this clears anything up for you!

@csells
Copy link
Author

csells commented May 23, 2025

thanks, @pq. if I override the default and choose the Flutter generator after choosing New Flutter Project, I get a Flutter project. I don't know why that's not the default; it certainly should be.

@pq pq changed the title [bug] Can't create a Flutter project in the latest Android Studio Auto-select the flutter generator when invoking the new project wizard from the "New Flutter Project..." action May 23, 2025
@pq pq removed their assignment May 23, 2025
@pq
Copy link
Contributor

pq commented May 23, 2025

Ok, cool! I agree it's not the best behavior. I'm not sure if IntelliJ's NewProjectWizard gives us a good way to set the default but I've turned this into an enhancement request so we can loop back and check it out.

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants