10

Recently (after install Android Studio 2.3.x, I'm now at 2.3.1) the emulator won't start in Android Studio.

I can run the emulator from the command line if it is in the SDK\tools directory.

If I run the emulator from a directory other than the SDK\tools directory I get an error like this:

[12236]:ERROR:./android/qt/qt_setup.cpp:28:Qt library not found at ..\emulator\lib64\qt\lib
Could not launch '..\emulator/qemu/windows-x86_64/qemu-system-i386.exe': No such file or directory

The tools and platform-tools directories are in my path. Android_home is set correctly. First I tried re-installing the emulator from the SDK manager in Android (now that the standalone SDK manager is gone I can't do it there). I manually downloaded the SDK and installed it overtop of the old SDK. I then tried putting it in a new directory and changing the ANDROID_HOME and updating my paths and changed the setting in Android Studio (and all the local.properties files). Next I completely uninstalled Android Studio and SDK, rebooted and reinstalled Android Studio. Still having the same problem.

I've tried the suggestions here in the question here: Emulator on Android Studio doesn't start after SDK tools update to 25.3.1 by copying various directories (first sym-links then copy directories as sym-links work differently on windows).

I've tried all the suggestions here: https://issuetracker.google.com/issues/37137213 as well.

I've re-installed HAXM, but I don't think it is an Emulator problem as it does work when I start it from a command prompt in the tools directory.

Any suggestions?

Details:
Windows 10 (Build 1703)
Android Studio 2.3.1

Community
  • 1
  • 1
Kris Erickson
  • 33,454
  • 26
  • 120
  • 175
  • Google recently moved emulators libs from /yoursdk/tools to /yoursdk/emulator and jeeeez they messed all emulator preexistent configs over all OS. I helped a few people over Linux and Mac to solve the problem, but I don't have a Windows enviroment to check, Over Windows placing /yoursdk/emulator path before /yourdsk/tools on your Enviroment PATH must make it work. Did you tried that? – Martin Revert Apr 25 '17 at 23:22
  • @MartinRevert getting closer, can now run the emulator from the command-line from anywhere (don't have to be in the SDK\tools or SDK\emulator directory) but still doesn't work from Android Studio... – Kris Erickson Apr 26 '17 at 14:35
  • Today they pushed a new patch for Android Emulator, it is versioned like 26.0.2. Can you update and try again?. AFAIK they claim that they solved the problem for all platforms, but they broke (one more time) my config over Linux. But again, I'm not over Windows, so maybe for you worth a try **Help --> Check Updates.** – Martin Revert Apr 26 '17 at 18:15
  • @MartinRevert not available for me yet, still at 26.0.0 (I think it is only in the Beta channel). I'll update question when 26.0.2 becomes available. – Kris Erickson Apr 27 '17 at 14:53
  • @MartinRevert Emulator didn't work at 26.0.2, it is now at at 26.0.3 and still no dice. – Kris Erickson Jun 14 '17 at 16:09

2 Answers2

6

I've resolved the problem in this way:

in command line, from the folder containing avd images, I've run the emulator.exe against a virtual device image using the switch -gpu swiftshader.

To be precise, in my case, in command line, from the folder C:\<Users>\.android\avd I've typed

<android sdk folder>\emulator\emulator.exe @Nexus_4_Lollipop -gpu swiftshader

where Nexus_4_Lollipop is a name of the avd image.

Andrew
  • 2,148
  • 5
  • 23
  • 34
  • I can run the emulator from the command line (it has to be run from the SDK\tools directory), that isn't the problem. I want to be able to have it run from Android Studio. – Kris Erickson Apr 19 '17 at 14:58
  • Once you run the emulator, it should be available among running ones when you run the app from Android Studio. – Andrew Apr 19 '17 at 19:39
  • Yes, of course it is available. But I want to be able to control emulators from Android Studio and not have to go to the command line. – Kris Erickson Apr 19 '17 at 20:49
  • As far as I know, in previous versions of Android Studio, it was possible to configure the emulator with additional parameters. For the time being (Android Studio 2.4 Preview 6), that possibility has not been re-introduced. I'm afraid that the only option is to start the emulator from the command line. – Andrew Apr 20 '17 at 05:40
  • @Andrew Be aware that swiftshader is a sofware emulation and it is not the fastest or smoothest experience. The best opiton always is to use your computer's GPU as host (-gpu host) but if this is not working for you, you may have a OpenGL config problem. – Martin Revert Jun 15 '17 at 08:18
  • @Andrew I struggled a lot launching the emulator through `android studio 2.3.3` but was very frustrating. Your solution ` -gpu swiftshader` helped. Thanks a lot but as you said its very very slow. Emulator hardly comes to home screen and then again go back to a blank (black) screen. Changing of screen continues automatically. Is there a better solution? – Sanchit Oct 09 '17 at 02:54
0

Changing Graphics settings from "Automatic" to "Software - GLES 2.0" in Virtual Device Configuration worked for me. I think it's the same as "-gpu" command line option, but not all modes available: https://developer.android.com/studio/run/emulator-acceleration.html