6

on Ubuntu 16.04 I have installed AndroidStudio and via its AVD manager GUI did create tow new devices. now on Terminal when I type emulator -list-avds it lists the devices correctly, but when run emulator -avd <name> I face errors:

[139684796983104]:ERROR:android/android-emu/android/qt/qt_setup.cpp:28:Qt library not found at ../emulator/lib64/qt/lib
Could not launch '/home/amir/../emulator/qemu/linux-x86_64/qemu-system-i386': No such file or directory

How should I solve it?

3 Answers 3

2

In Ubuntu 19.10!

With the environment variables already configured ($ANDROID_HOME), you should be able to list the AVDs, but if you are unable to start the AVD, do the following:

# Check the AVD target name

emulator -list-avds

# But to start do:

$ANDROID_HOME/emulator/emulator @avd_name

or

/home/$USER/Android/Sdk/emulator/emulator @avd_name

1
  • had the same problem in macos and this worked like a charm Jul 11, 2020 at 23:58
1

I'm pretty sure you can solve this by calling the emulator from the directory where it is installed: e.g.

$ cd /home/amir/Android/Sdk/tools/
$ emulator -avd <name>

Consider creating an env variable $ANDROID_HOME.

If your directory matches my example above, set the variable to /home/amir/Android/Sdk (don't include tools).

Some people report that this resolved the problem for them, so that they didn't even need to start the emulator from within the tools directory.

I cannot confirm this though, but it's easier to cd $ANDROID_HOME/tools && emulator <name>, isn't it?

3
  • 1
    Ok. Got it. First try to launch it from within your Android/Sdk/tools directory. If this works, add $ANDROID_HOME/emulator to your PATH (e.g. vim ~/.bashrc or vim ~/.zshrc or whatever is appropriate for you). Open a new terminal and then you can launch emulator from everywhere. Note however: it is important that the emulator directory is placed before the tools directory. Feb 14, 2018 at 0:32
  • Thanks, man, it worked its weird. but I get this error do you anything about this too : emulator: ERROR: Missing initial data partition file: /home/amir/.android/avd/nexus4.avd/userdata.img Feb 14, 2018 at 0:57
  • See stackoverflow.com/questions/47895124/… – seems to be a one time error that goes away after first start. Correct? Feb 14, 2018 at 6:36
0

Had this error recently on Arch Linux. Simplest resolution for me was to add an alias to ~/.profile like this:
alias emulator='cd /home/myusername/Android/Sdk/tools ; emulator

Then you can just use it normally, i.e. emulator -avd <name> without having to worry about switching directories beforehand.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .