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

Android Studio Emulator cannot be embedded for Flutter project

Open Gabriel2048 opened this issue 3 years ago • 7 comments

This issue is a parity inconsistency between regular Android projects and Flutter Android projects. Apparently this is not a bug within Android Studio as there are some complains (here or here(this also has an technical explanation that might be valuable)) about it in the Android Studio's issue tracker and they mention this should be addressed to the Flutter Plugin team.

Steps to Reproduce

1)Create a new Flutter project using the flutter plugin 2) Go to Settings > Tools > Emulator 3) Check "Launch in a tool window" option 4) Save changes and close the settings window. 5) Go to AVD manager and start an emulator

Actual result: The emulator is being started as a new windows app (see attached screenshot). Expected result: The emulator is started in the tools section of Android Studio (embedded). image

Version info

[√] Flutter (Channel stable, 2.8.1, on Microsoft Windows [Version 10.0.22000.434], locale en-US) • Flutter version 2.8.1 at C:\dev\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 77d935af4d (5 weeks ago), 2021-12-16 08:37:33 -0800 • Engine revision 890a5fca2e • Dart version 2.15.1

[√] Android toolchain - develop for Android devices (Android SDK version 32.0.0) • Android SDK at C:\Users\iliec\AppData\Local\Android\sdk • Platform android-32, build-tools 32.0.0 • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189) • All Android licenses accepted.

[X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe) ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[√] Android Studio (version 2020.3) • 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.10+0-b96-7249189)

[√] VS Code (version 1.63.2) • VS Code at C:\Users\iliec\AppData\Local\Programs\Microsoft VS Code • Flutter extension can be installed from: https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[√] Connected device (2 available) • sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64 • Android 12 (API 32) (emulator) • Edge (web) • edge • web-javascript • Microsoft Edge 96.0.1054.62

! Doctor found issues in 1 category.

Gabriel2048 avatar Jan 19 '22 19:01 Gabriel2048

The Flutter plugin does not launch the emulator in an embedded view. To do that you need to use the Android Studio Device Manager. If you don't see the Device Manager in the View > Tool Windows menu then refer to https://github.com/flutter/flutter-intellij/issues/5464 for details on adding an Android module to your project, which will enable it.

stevemessick avatar Jan 20 '22 17:01 stevemessick

@stevemessick Thank you, the fix you mentioned in here is working, I am now able to launch the emulator in the tools window. However, wouldn't it make sense to have the flutter plugin add the module automatically when creating the project in the first place?

Gabriel2048 avatar Jan 20 '22 17:01 Gabriel2048

Yes, that is the topic of #5464. I'm leaving this issue open as a reminder to added embedded launch mode to the Flutter plugin.

stevemessick avatar Jan 20 '22 18:01 stevemessick

@stevemessick I see you closed https://github.com/flutter/flutter-intellij/issues/5464 so I assume this item can also be closed

Gabriel2048 avatar Feb 02 '22 20:02 Gabriel2048

@Gabriel2048 I don't know. I have not tested this feature yet.

stevemessick avatar Feb 02 '22 21:02 stevemessick

No, this issue is not fixed. However, I'm closing it as a dup of #5917, since that one is asking for even more.

stevemessick avatar Feb 09 '22 18:02 stevemessick

Re-opening since the other has two topics and this isn't the first.

stevemessick avatar May 20 '22 14:05 stevemessick

@stevemessick isn't this fixed by https://github.com/flutter/flutter-intellij/pull/6279?

pedromassango avatar Dec 09 '22 13:12 pedromassango

Yes, thanks. Closing.

stevemessick avatar Dec 09 '22 15:12 stevemessick