2

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?

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?

|improve this answer|||||
  • 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. – Thomas Praxl Feb 14 '18 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 – Amir-Mousavi Feb 14 '18 at 0:57
  • See stackoverflow.com/questions/47895124/… – seems to be a one time error that goes away after first start. Correct? – Thomas Praxl Feb 14 '18 at 6:36
0

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

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.