Sreenivas T
Sreenivas T

Reputation: 59

No Suitable Android AVD Available

enter image description here

No suitable Android AVD System images are available

Upvotes: 3

Views: 16769

Answers (7)

Kevin Ng
Kevin Ng

Reputation: 476

I got the same problem too, here is what I did differently.

  1. Install android studio.
  2. Open Android studio > More Actions > Virtual Device Manager > Create device > Select Device > Select System Image "Orea version 27"
  3. Make sure your hard disk have enough free space to run the emulator.
  4. On VS code, navigate to lib > main.dart.
  5. Right click on main.dart > click on "Start Debugging"

enter image description here

Upvotes: 1

Alish Giri
Alish Giri

Reputation: 2246

It means that you don't have an Image to create an Emulator.

Install Android Studio and follow these instructions.

Step One - Open Virtual Device Manager

Step Two - Click on Create Virtual Device

We will not complete the virtual device creation process so choose any device definition as we just need to get to the next step and install the image.

Press Next.

Step Three - Coose a device definition

Finally dowload any image of your choice and after download completes. Cancel the process of creating a virtual device and continue Emulator creation from the VScode or free feel to continue.

Step 4 - Download the image that is causing this issue.

Upvotes: 0

Sharon A
Sharon A

Reputation: 2665

This error appears when the Android emulator you're trying to use doesn't have the required system image installed. I encountered this error while attempting to run an Android emulator in VSCode on my new MacBook before properly configuring it.

To resolve this issue, you first need to make sure that the SDK tools required to use the Android emulator are installed. To do this:

  1. Open Android Studio.
  2. In the top nav bar, click Tools -> SDK Manager.
  3. Click SDK Tools, (highlighted in blue).
  4. Check Android Emulator and Android SDK Platform-Tools.
  5. Click Apply followed by Ok, then Finish once the installation is complete.

Once you've installed the SDK tools, create a device by following these steps:

  1. In Android Studio, in the top nav bar, click Tools -> Device Manager.
  2. Click Create Device then select the device.
  3. In the 'System Image' screen, select a system image. If you're not sure which one to select, click the API level distribution chart link on the right panel next to the list of system images.
  4. Click 'Next' and wait for the operating system image to download.
  5. Once the download is complete, the emulator device will appear in the Device Manager in Android Studio. Note that if you're using VSCode, you'll need to restart it for the new emulator to appear.

Upvotes: 0

Tboi
Tboi

Reputation: 53

This article is helpful for manjaro users on commandline: A simple, fast and lightweight Flutter dev environment on Manjaro

Steps

  • Download commandline tools only from Android Developer's Site

  • Extract the files on some /android folder

  • Create a folder “latest” inside the folder /android/cmdline-tools

  • Copy all the files into the “latest” folder

  • Add the bin folder to the PATH environment variable:

    export PATH=/path/to/android/cmdline-tools/latest/bin:$PATH

Upvotes: 2

Luis De la Cruz
Luis De la Cruz

Reputation: 41

in powershell

Android SDK\tools\bin> .\sdkmanager "system-images;android-27;google_apis_playstore;x86"

Upvotes: 0

Malaz Tamim
Malaz Tamim

Reputation: 61

Follow the following steps:

  1. Run sdkmanager "system-images;android-27;google_apis_playstore;x86" If it starts downloading then you are done. Otherwise, go to step 2

  2. Check if there is a path for Android SDK under System Environment Variable PATH(Open Windows Control Panel and go to System (Control Panel->System and Security->System, select Advanced system settings, click on Environment Variable, In System variables section click on 'Path'). The path for Android SDK is usually C:\Users{Your laptop username}\AppData\Local\Android\sdk\tools\bin.

    If it is not there, find the Android SDK path and it (pointing to your SDK tools bin*** location)

  3. Run Windows Powershell and run the following command: sdkmanager "system-images;android-27;google_apis_playstore;x86"

    If it starts downloading then wait until it is finished and and run the sdkmanger command above again and finally go to VS code and click on ctrl-shift-p and write Flutter: Select Device-> Create Android Emulator and it will not show the error message.

  4. If you get this error after running the sdkmanger command : Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema Then you have to install multiple versions of Java because there is something wrong in the last version of Java. Download Java8 JDK from Oracle and install it. Then, copy Java8 JDK (it is usually C:\Program Files\Java\jdk1.8.0_271) and go to Environment variables (following the instructions in step 1). In system variables click on JAVA-HOME and paste the copied path of Java 8 instead of the path of last version and click on Ok.

  5. Click on Path (in system variables) and search on the path of last java version, click on it and paste Java 8 bin location (C:\Program Files\Java\jdk1.8.0_271bin) and click ok.

  6. Exit the cmd and launch it (if you were using it before) and run the command: java -version You should get the following output:

    java version "1.8.0_271"

    Java(TM) SE Runtime Environment (build 1.8.0_271-b09)

    Java HotSpot(TM) 64-Bit Server VM (build 25.271-b09, mixed mode)

    Thus, we have installed Java8 JDK.

  7. Now run Windows Powershell and run the following command: sdkmanager "system-images;android-27;google_apis_playstore;x86" and it should start downloading.

  8. Go to VS code and click on ctrl-shift-p and write Flutter: Select Device-> Create Android Emulator and it will not show the error message.

  9. You can delete Java8 JDK and JRE now and reset the path of JAVA-HOME (copy the location of the last Java JDK and paste it there) and the path of Java bin to the original Path (System Variables->Path and change it to the Java bin location of the last version)

Upvotes: 4

Danny Tuppeny
Danny Tuppeny

Reputation: 42433

This happens when your Android SDK does not have the required components downloaded to create the type of emulator Flutter is trying to create. As notced in the message, the fix is to run:

sdkmanager "system-images;android-27;google_apis_playstore;x86"

If you get an error like sdkmanager not found you'll need to put the full path to your Android SDK's tools/bin folder (or to add that folder to your PATH and try again).

Upvotes: 8

Related Questions