Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Emulator does not work on Ubuntu after upgrading Android Studio to 2.0 - Qt library not found

Today, I updgraded my Android Studio installation to version 2.0. I updated it manually (download the .zip, because the update mechanism just telled me that there is a new version but offered no possibility for direct update in Android Studio). When I now try to start an emulator, I receive this error message:

ERROR:./android/qt/qt_setup.cpp:33:Qt library not found at /home/kcd/Android/Sdk/tools/lib/qt/lib Could not launch '/home/kcd/Android/Sdk/tools/qemu/linux-x86/qemu-system-x86_64': No such file or directory

I checked this directory and notices that the path name is .../qemu/linux-x86_64/qemu-system_x86_64 and not .../qemu/linux-x86/qemu-system_x86_64

So I renamed the direcory to match the correct path. After trying to launch the emulator, it puts this error message:

ERROR:./android/qt/qt_setup.cpp:33:Qt library not found at /home/kcd/Android/Sdk/tools/lib/qt/lib

emulator: WARNING: VM heap size set below hardware specified minimum of 228MB

This application failed to start because it could not find or load the Qt platform plugin "xcb". emulator: WARNING: Setting VM heap size to 384MB

My system is Ubuntu 14.04 64 bit. Before the update to Android Studio 2.0, everything worked fine.

Can anyone help?

EDIT: After testing the answer from Anurag Maheshwari, this error disappeared. Then I have got the following error message:

Cannot launch AVD in emulator. Output: emulator: WARNING: VM heap size set below hardware specified minimum of 228MB emulator: WARNING: Setting VM heap size to 384MB emulator: ERROR: Could not load OpenGLES emulation library [lib64OpenglRender]: lib64OpenglRender.so: Kann die Shared-Object-Datei nicht öffnen: Datei oder Verzeichnis nicht gefunden console on port 5554, ADB on port 5555 emulator: ERROR: Could not initialize OpenglES emulation, use '-gpu off' to disable it.

I tried to use '-gpu off', but it still does not want to start...

like image 371
KCD Avatar asked Apr 08 '16 09:04

KCD


People also ask

Why is my emulator not working Android Studio?

If the emulator fails to launch due to the error vulkan-1. dll cannot be found , you probably need to update the emulator. To update the emulator in Android Studio, go to Tools > SDK Manager and install the latest stable version of Android platform.

How do I get my Android Emulator to work?

Run your app on the emulator After you have created an Android Virtual Device (AVD), you can start the Android Emulator and run an app in your project: In the toolbar, select the AVD that you want to run your app on from the target device drop-down menu. Click Run.

How do I enable Android Emulator in Visual Studio?

Just open up the Visual Studio Emulator for Android entry in your Start Menu, hit play, and the emulator is ready to debug from any IDE. Download the standalone emulator today!


2 Answers

I got the same problem. It may be occur due to your 64bit linux didn't match to the avd you installed. Try copy 'lib' folder from your Android sdk location -> ../Android/Sdk/tools/lib64/qt/lib to ../Android/Sdk/tools/lib/qt/lib It worked for me.

like image 186
Anurag Maheshwari Avatar answered Oct 20 '22 00:10

Anurag Maheshwari


Finally I've managed it. While testing from command line (-gpu off), it does not seem to work, but when I use the Virtual Device Manager and choose "Emulated Performance - Graphics --> Software - GLES 2.0" instead of "Hardware - GLES 2.0", the emulator starts. Unfortunately, it a bit slower now, and I wonder why it worked before the upgrade, but my emulators are running for now.

like image 21
KCD Avatar answered Oct 19 '22 23:10

KCD