Android Studio Emulator not showing up to run flutter app

3.7k Views Asked by At

I am trying to run my Flutter app in Android Studio. But when I try to select a device to launch, I am prompted to launch the Android Emulator, which is already running. When running the flutter devices command, the following message is displayed:

• Device emulator-5554 is not authorized.
You might need to check your device for an authorization dialog.

I tried to find a solution (similar problem) but it didn't help.

The output of flutter doctor:

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.7.11, on Microsoft Windows [Version 10.0.22621.1555], locale ru-RU)
[X] Windows Version (Unable to confirm if installed Windows version is 10 or greater)
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[√] Chrome - develop for the web
[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 2022.2)
[√] VS Code (version 1.77.3)
[√] Connected device (3 available)
    ! Device emulator-5554 is not authorized.
      You might need to check your device for an authorization dialog.
[√] HTTP Host Availability

! Doctor found issues in 2 categories.

JAVA_HOME value:

C:\Program Files\Android\Android Studio\jbr

USB debugging is enabled (screenshot), but nothing happens when running flutter devices or flutter doctor. Trying to revoke permissions and execute commands again does not help either.

2

There are 2 best solutions below

2
On

Have you tried to create a new emulator? Make sure that the emulator is google play compatible.

You can also try to run the command adb devices and see if the emulator shows up.

IF the new emulator dosent work try to turn it of and run the command

adb kill-server and then adb start-server

And start the emulator agian and see if it works then.

Hope this helps

0
On

So, I got a problem with the Pixels 2 and 2 XL API 28 (Pie) and here's what to do :

  • Set and run the device normally
  • Turn on the developer features: go to the settings, then 'System', 'About Emulated Device', tap 5 times on 'Build Number'
  • Go back, reveal the advanced options, then go to 'Developer Options'
  • Make sure 'USB debugging' is on
  • Find 'default USB configuration'
  • Click on it, it will open a menu, then select 'File Transfer' instead of 'No data transfer'
  • I think it's good but you can also click inside your notifications on 'Virtual SD card' and set it for transferring photos and media, in order to be sure
  • Open your PowerShell (or cmd, or what you want) with the emulator still opened and check if it's getting recognized with 'flutter doctor' or 'flutter devices'
  • Go to your project folder with 'cd [your folder's path]'
  • Type 'flutter run' to launch your app in the emulator

It should work! It did for me, I think the problem comes from the USB default configuration. I hope it helped, have a nice programming session!