flutter / flutter-intellij

Flutter Plugin for IntelliJ
https://flutter.dev/using-ide
BSD 3-Clause "New" or "Revised" License
1.98k stars 319 forks source link

I cannot open the Device Manager in Android Studio in a Flutter project #5966

Closed lukaszciastko closed 2 years ago

lukaszciastko commented 2 years ago

Steps to Reproduce

Create a new Flutter application in Android Studio Bumblebee | 2021.1.1 Patch 1. Try to open the Device Manager (by clicking on the icon or Tools -> Device Manager) - nothing happens.

Version info

Android Studio Bumblebee | 2021.1.1 Patch 1 Build #AI-211.7628.21.2111.8139111, built on February 1, 2022 Runtime version: 11.0.11+0-b60-7772763 aarch64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. macOS 12.1 GC: G1 Young Generation, G1 Old Generation Memory: 2048M Cores: 8 Registry: external.system.auto.import.disabled=true Non-Bundled Plugins: Dart (211.7798), org.jetbrains.kotlin (211-1.6.10-release-923-AS7442.40), io.flutter (64.1.2), com.jetbrains.kmm (0.3.0(211-1.6.0-release-795-IJ)-194)

Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 2.10.1, on macOS 12.1 21C52 darwin-arm, locale en-GB) [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 13.2.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2021.1) [✓] IntelliJ IDEA Community Edition (version 2021.3.1) [✓] VS Code (version 1.64.2) [✓] Connected device (2 available) [✓] HTTP Host Availability

stevemessick commented 2 years ago

It works for me. I created this project, then clicked the Device Manager icon on the tool bar.

Screen Shot 2022-02-14 at 9 04 09 AM

This used to happen when the Flutter project did not contain an Android module. Which version of the Flutter plugin do you have installed? That problem was fixed in version 64 of the plugin.

Jayasubin commented 2 years ago

The problem is real, friend. In my setup, Device manager opens up in a new project, but refuses to open in an existing project

`[√] Flutter (Channel stable, 2.10.1, on Microsoft Windows [Version 10.0.19044.1526], locale en-IN) • Flutter version 2.10.1 at C:\bin\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision db747aa133 (7 days ago), 2022-02-09 13:57:35 -0600 • Engine revision ab46186b24 • Dart version 2.16.1 • DevTools version 2.9.2

[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0) • Android SDK at C:\Users\Crestronics-Flutter\AppData\Local\Android\sdk • Platform android-31, build-tools 31.0.0 • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java • Java version OpenJDK Runtime Environment (build 11.0.11+9-b60-7590822) • All Android licenses accepted.

[√] Chrome - develop for the web • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[X] Visual Studio - develop for Windows X Visual Studio not installed; this is necessary for Windows development. Download at https://visualstudio.microsoft.com/downloads/. Please install the "Desktop development with C++" workload, including all of its default components

[√] Android Studio (version 2021.1) • Android Studio at C:\Program Files\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 11.0.11+9-b60-7590822)

[√] VS Code (version 1.64.2) • VS Code at C:\Users\Crestronics-Flutter\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.34.0

[√] Connected device (3 available) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19044.1526] • Chrome (web) • chrome • web-javascript • Google Chrome 98.0.4758.102 • Edge (web) • edge • web-javascript • Microsoft Edge 98.0.1108.50

[√] HTTP Host Availability • All required HTTP hosts are available

! Doctor found issues in 1 category. `

System info:

lukaszciastko commented 2 years ago

I think it might be an intermittent issue. I opened the project now, and I can open the Device Manager - in an existing project. Strange. It's similar to what I usually experience with the "New Flutter Project" buton in Android Studio - sometimes it's there, and sometimes it's gone.

Update: It looks like this really works intermittently, and I can't identify any patterns. Sometimes it works, sometimes it doesn't work.

stevemessick commented 2 years ago

Which version of the Flutter plugin do you have installed?

tva77 commented 2 years ago

I realized that only for old projects the device manager doesn't work. For new projects created with the actual version of Android Studio is working well.

stevemessick commented 2 years ago

@tva77, yes that's a known problem. See #5932.

no-response[bot] commented 2 years ago

Without additional information we're unfortunately not sure how to resolve this issue. We're going to close this bug for now, but please don't hesitate to comment on the bug if you have any more information for us; we're happy to reopen. Thanks for your contribution!

doug-descombaz commented 1 year ago

I have a similar issue, but I think I know the pattern. If I run "flutter upgrade" in the terminal, the SDK that the Android Studio thought I had for Flutter disappears from the UI. The solution is for me to re-set the project's Flutter SDK after upgrades. I've seen this happen a few times now.