flutter-intellij icon indicating copy to clipboard operation
flutter-intellij copied to clipboard

Invalid Platform selected by default in project

Open strangedreamsNY opened this issue 6 months ago • 6 comments

It might be a problem with Android Studio specifically and I'll report it over there too, but I fully expect that team to try and point back to here...so...

When working on Flutter projects, the platform selection box for launching run/debug configuration should not show platforms that the project isn't configured for.

Reproduction on a Linux computer:

  • Open Android Studio
  • Create a New Flutter Project
  • de-select all platform options except Android

Expectations: I shouldn't see 'Linux' as a platform in my launcher, only running Android Devices Actual: I see Linux. (see attached image).

This presents as a problem for the user when running devices are 'power cycled' since Linux becomes the default selection when the AVD is turned off and is not reverted back to the AVD selection when the device is turned on again. It really shouldn't show any invalid targets that the project isn't configured for.

Image

Image

Android Studio Meerkat Feature Drop | 2024.3.2 Patch 1 Build #AI-243.26053.27.2432.13536105, built on May 22, 2025 Runtime version: 21.0.6+-13368085-b895.109 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Toolkit: sun.awt.X11.XToolkit Linux 6.8.0-59-generic Linux Mint 21.2; glibc: 2.35 GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation Memory: 4096M Cores: 36 Registry: ide.experimental.ui=true Non-Bundled Plugins: Dart (243.26753.1) io.flutter (85.3.1)

Current Desktop: X-Cinnamon

strangedreamsNY avatar Jun 07 '25 17:06 strangedreamsNY

Poked a bit, didn't see a way to really demonstrate this problem in non-flutter projects, so it might genuinely be a flutter plugin problem. If we as a community could build and contribute, I would have loved to provide a fix, but since it seems we're discouraged from doing so, I leave it in your capable hands!

strangedreamsNY avatar Jun 07 '25 17:06 strangedreamsNY

Thanks for taking a look @strangedreamsNY! If you happen to dig any deeper, I'm happy to look at a PR.

If we as a community could build and contribute, I would have loved to provide a fix, but since it seems we're discouraged from doing so

Sorry to hear you feel discouraged. Not to derail this thread, but could you point me to some more context?

pq avatar Jun 11 '25 23:06 pq

Sorry to hear you feel discouraged. Not to derail this thread, but could you point me to some more context?

Things like this: https://issuetracker.google.com/issues/248536235?pli=1 make it difficult to dig in to what's happening between plugins like Flutter and Android Studio (I know they're not the same teams but they are 'co-located' for all intents and purposes). I had tried (unsuccessfully) to build against the flutter plugin some while back(1y+) and am trying to revisit the process. The docs seemed to suggest I needed to build the plugin tool prior to building the Flutter plugin but that process fails due to missing template files (product-matrix.json, studio_contribs_template.xml, etc...)which may be rectified by loading it all in Android Studio after some other hoop jumping, but an unrelated file-system issue is keeping me from following up atm. I suspect the crux of the problem there is that builds require blaze internally (which usually works) but that process isn't updated when the docs are tossed 'over the fence' with the rest of the source code, so we (pub devs) get a mix of internal/external docs.

strangedreamsNY avatar Jun 12 '25 14:06 strangedreamsNY

Our setup is regrettably complicated. I recently swung back to work on this project and I feel your pain. Onboarding is hard all around. The hopefully good news is that @helin24 and @jwren are looking at simplifying our gradle build and once they have, this should become WAY easier.

In the meantime, FWIW, we don't build or develop against Android Studio sources. Personally I develop w/ IDEA Ultimate. I followed the CONTRIBUTING docs which mostly worked IIRC.

@helin24: would feedback from users trying to contribute be useful to you?

Thanks again for your time @strangedreamsNY. You've put a lot into your reports and they're greatly appreciated. Sorry contributing isn't easier!

pq avatar Jun 12 '25 16:06 pq

would feedback from users trying to contribute be useful to you?

Yes! We are frequently updating the contributing file @pq linked as we encounter new issues during setup. @strangedreamsNY I think you're referring to having to run some steps inside the bin/plugin directory, which is Dart code for building the plugin? For now the best process is probably to make an issue with error messages from following the contributing doc and we can help with setup.

I think in general, our contributing instructions are pretty low-level, and we do a terrible job of providing a quick setup route for potential contributors. The instructions now are assuming someone wants to develop the project and also build and release the plugin. Our first priority should be to work on our gradle build (since that may simplify our setup steps) and then consider re-writing our instructions with more explanation of how to set up depending on your goals.

helin24 avatar Jun 12 '25 16:06 helin24

@strangedreamsNY echoing Phil that I appreciate the time you've taken to inform us in your issue reports. Sorry I have not gotten back to other issue comments sooner!

helin24 avatar Jun 12 '25 16:06 helin24