flutter-intellij
flutter-intellij copied to clipboard
Flutter and Android Studio, Project structure: "Add Android SDK from disk" not working
Configuration Android Studio Ladybug Feature drop 2024.2.2) Latest flutter SDK and Android Studio plugins Android SDK installed: 30, 32, 33, 34, 35 (see attached screenshots)
Issue Trying to add Android SDK to a flutter project structure does not work anymore.
Steps
Open flutter project. Go to "Project structure"; only SDKs 34 and 35 are visible. Right click, select "Add SDK", select "Add Android SDK from disk" Window opens and points to the SDK home folder; installed SDKs are visible in the "platforms" subfolder (see screenshots) Click OK: nothing happens!
Expected results When pressing OK at step 5. a dialog box allows to select one of the SDKs in the SDK home folder. A new SDK entry in the Project structure is added.
Actual results When pressing OK, the dialog box is dismissed. No error messages given, nothing happens.
Further
Same on a different installation/system (Ladybug 2024.2.1 Patch1). A previous version (Hedgehog 2023.1.1 Patch 1) works as expected and allows me to add existing Android SDKs.
Also opened as Android Studio bug https://issuetracker.google.com/issues/390889635, closed as "flutter related". Also opened as Flutter bug https://github.com/flutter/flutter/issues/161910, closed as "flutter intellij related".
Flutter Doctor output
[√] Flutter (Channel stable, 3.27.1, on Microsoft Windows [Version 10.0.22631.4602], locale en-CH) • Flutter version 3.27.1 on channel stable at d:\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 17025dd882 (5 weeks ago), 2024-12-17 03:23:09 +0900 • Engine revision cb4b5fff73 • Dart version 3.6.0 • DevTools version 2.40.2
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 35.0.0) • Android SDK at D:\Android\SDK • Platform android-35, build-tools 35.0.0 • Java binary at: D:\Android\Android Studio\jbr\bin\java • Java version OpenJDK Runtime Environment (build 21.0.4+-12508038-b607.1) • All Android licenses accepted.
[√] Chrome - develop for the web • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop Windows apps (Visual Studio Professional 2022 17.11.5) • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Professional • Visual Studio Professional 2022 version 17.11.35327.3 • Windows 10 SDK version 10.0.26100.0
[√] Android Studio (version 2024.2) • Android Studio at D:\Android\Android Studio • Flutter plugin can be installed from: https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 21.0.4+-12508038-b607.1)
[√] VS Code (version 1.96.4) • VS Code at C:\Users\Andrea\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.102.0
[√] Connected device (3 available) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22631.4602] • Chrome (web) • chrome • web-javascript • Google Chrome 131.0.6778.266 • Edge (web) • edge • web-javascript • Microsoft Edge 128.0.2739.42
[√] Network resources • All expected network resources are available.
• No issues found!
Issue still present after upgrading to Android Studio Meerkat | 2024.3.1 Patch 1, Flutter plug-in 83.0.4.
When pressing "OK" on the dialog box at point 5 in the "Steps", the following "SEVERE" is traced in IDEA.LOG.
2025-03-25 21:26:38,628 [ 338050] SEVERE - #c.i.o.p.Task - Access is allowed from Event Dispatch Thread (EDT) only; If you access or modify model on EDT consider wrapping your code in WriteIntentReadAction or ReadAction; see https://jb.gg/ij-platform-threading for details
Current thread: Thread[#250,ApplicationImpl pooled thread 16,4,main] 676773733 (EventQueue.isDispatchThread()=false)
SystemEventQueueThread: Thread[#109,AWT-EventQueue-0,6,main] 802012382
com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments: Access is allowed from Event Dispatch Thread (EDT) only; If you access or modify model on EDT consider wrapping your code in WriteIntentReadAction or ReadAction; see https://jb.gg/ij-platform-threading for details
Current thread: Thread[#250,ApplicationImpl pooled thread 16,4,main] 676773733 (EventQueue.isDispatchThread()=false)
SystemEventQueueThread: Thread[#109,AWT-EventQueue-0,6,main] 802012382
at com.intellij.util.concurrency.ThreadingAssertions.createThreadAccessException(ThreadingAssertions.java:218)
at com.intellij.util.concurrency.ThreadingAssertions.throwThreadAccessException(ThreadingAssertions.java:209)
at com.intellij.util.concurrency.ThreadingAssertions.assertEventDispatchThread(ThreadingAssertions.java:78)
at com.intellij.openapi.ui.DialogWrapper.