Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot run Flutter App on Android Emulator

I'm using Android Studio to create Flutter application. It works perfectly on iOS simulators, however, I cannot run it on Android emulators.

iOS As you can see in the screenshot, I can see my iPhone 8 simulator but I cannot see Android emulator, although I'm running "Pixel 2" emulator.

You can see my virtual devices in the screenshot below.

Android

Update 1:

This is the output of flutter doctor:

[✓] Flutter (Channel beta, v0.3.2, on Mac OS X 10.13.4 17E202, locale en-KW)
[✓] Android toolchain - develop for Android devices (Android SDK 26.0.2)
[✓] iOS toolchain - develop for iOS devices (Xcode 9.3)
[✓] Android Studio (version 3.1)
[✓] VS Code (version 1.23.1)
[✓] Connected devices (1 available)

• No issues found!
like image 318
Mohammed Avatar asked May 14 '18 18:05

Mohammed


People also ask

How do I run the Flutter app on Android emulator?

Creating Connection Choose Device: Open your VS Code and from the bottom right corner of your home screen click on the Flutter Device option. Select Device: When you click on the Flutter Device icon, list of available devices will open up in the command palette. Select the emulator you just created.

Can I use BlueStacks for Flutter?

Flutter: Butterfly Sanctuary is a Simulation game developed by Runaway. BlueStacks app player is the best platform to play this Android game on your PC or Mac for an immersive gaming experience.


1 Answers

Short answer

Probably the Project SDK is not set. Set it from Android Studio;

  • File -> Project Structure -> Project Settings -> Project

Longer answer

I had the same issue;

  • flutter doctor command says everything is OK
  • AVDs are created with Android Studio's AVD Manager
  • Android Studio shows no devices to run app on

I realized that Flutter's doctor can be also run from Android Studio (Tools -> Flutter -> Flutter Doctor) and it had a problem with Android toolchain; said that SDK is not set. I am not sure how this doctor has different output from flutter doctor run from the project's directory, but it was the correct one. I just went to File -> Project Structure and under Project Settings -> Project selected the appropriate Project SDK - Android API xx Platform (was <No-SDK>).

like image 83
Sandro Lovnički Avatar answered Nov 02 '22 11:11

Sandro Lovnički