1

All was working until I upgraded. But now I can't start a virtual device. This is on Debian Jessie.

I've now wiped everything and reinstalled. I have the same problem: depending on how I configure my virtual device I get either (1) nothing at all or (2) a blank emulated 'phone window and a LOT of errors. See below.

Any suggestions at all as to how to move forward? I've been trying to get this re-installed all day, and nothing.

(NB: I've tried adb kill-server; adb start-server.)

I say I've wiped everything but perhaps I missed something. I completely removed:

* $HOME/Android
* $HOME/AndroidStudioProjects
* $HOME/.android
* $HOME/.AndroidStudio2.3
* $HOME/.gradle
* $HOME/.emulator_console_auth_token
* $HOME/.config/Android Open Source Project
* /usr/local/lib/android_studio (which is where I unzipped the download)

After installing from scratch again, running studio.sh from the command line, then trying to start a virtual device --- here's what I see on the command line:

[  28819]   WARN - run.EmulatorConnectionListener - Emulator not ready yet, dev.bootcomplete = null 
[  29831]   WARN - run.EmulatorConnectionListener - Emulator not ready yet, dev.bootcomplete = null 
[  30843]   WARN - run.EmulatorConnectionListener - Emulator not ready yet, dev.bootcomplete = null 
[  31854]   WARN - run.EmulatorConnectionListener - Emulator not ready yet, dev.bootcomplete = null 
[  32888]   WARN - run.EmulatorConnectionListener - Emulator not ready yet, dev.bootcomplete = null 

And here is what I see in ADS's "Android Device Monitor" screen (just the start of a massive rolling list of errors. I have my filter set to show errors only here):

06-28 13:46:54.821 1302-1302/? E/gralloc_ranchu: Could not find software fallback module!?

                                                 [ 06-28 13:46:54.821  1302: 1302 E/         ]
                                                 connect: failed with fd -1 errno 22

                                                 [ 06-28 13:46:54.821  1302: 1302 E/         ]
                                                 Failed to connect to host (QemuPipeStream)!!!
06-28 13:46:54.821 1302-1302/? E/gralloc_ranchu: gralloc: Failed to get host connection


                                                 [ 06-28 13:46:54.821  1302: 1302 E/         ]
                                                 connect: failed with fd -1 errno 22

                                                 [ 06-28 13:46:54.821  1302: 1302 E/         ]
                                                 Failed to connect to host (QemuPipeStream)!!!
06-28 13:46:54.821 1302-1302/? E/gralloc_ranchu: gralloc: Failed to get host connection
06-28 13:46:54.821 1302-1302/? E/hwcomposer: ranchu_hw_composer hwc_open could not open framebuffer
06-28 13:46:54.822 1302-1302/? A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x44 in tid 1302 (surfaceflinger)
06-28 13:46:54.822 1302-1302/? A/libc: Unable to open connection to debuggerd: Connection refused
06-28 13:46:55.143 1361-1361/? E/memtrack: Couldn't load memtrack module (No such file or directory)
06-28 13:46:55.143 1361-1361/? E/android.os.Debug: failed to load memtrack module: -2
06-28 13:46:55.188 1361-1361/? E/Minikin: addFont failed to create font /system/fonts/NanumGothic.ttf
06-28 13:46:55.188 1361-1361/? E/Minikin: addFont failed to create font /system/fonts/DroidSansFallback.ttf
06-28 13:46:55.188 1361-1361/? E/Minikin: addFont failed to create font /system/fonts/MTLmr3m.ttf
06-28 13:46:55.248 1361-1361/? E/EmojiFactory_jni: Failed to load libemoji.so: dlopen failed: library "libemoji.so" not found
06-28 13:46:55.458 1361-1361/? E/Hyphenator: error loading hyphenation /system/usr/hyphen-data/hyph-en-us.pat.txt
                                             java.io.FileNotFoundException: /system/usr/hyphen-data/hyph-en-us.pat.txt: open failed: ENOENT (No such file or directory)
                                                 at libcore.io.IoBridge.open(IoBridge.java:452)
                                                 at libcore.io.IoUtils$FileReader.<init>(IoUtils.java:207)
                                                 at libcore.io.IoUtils.readFileAsString(IoUtils.java:114)
                                                 at android.text.Hyphenator.loadHyphenator(Hyphenator.java:96)
                                                 at android.text.Hyphenator.init(Hyphenator.java:154)
                                                 at com.android.internal.os.ZygoteInit.preloadTextResources(ZygoteInit.java:207)
                                                 at com.android.internal.os.ZygoteInit.preload(ZygoteInit.java:186)
                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593)
                                              Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
                                                 at libcore.io.Posix.open(Native Method)
                                                 at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
                                                 at libcore.io.IoBridge.open(IoBridge.java:438)
                                                 at libcore.io.IoUtils$FileReader.<init>(IoUtils.java:207) 
                                                 at libcore.io.IoUtils.readFileAsString(IoUtils.java:114) 
                                                 at android.text.Hyphenator.loadHyphenator(Hyphenator.java:96) 
                                                 at android.text.Hyphenator.init(Hyphenator.java:154) 
                                                 at com.android.internal.os.ZygoteInit.preloadTextResources(ZygoteInit.java:207) 
                                                 at com.android.internal.os.ZygoteInit.preload(ZygoteInit.java:186) 
                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593) 
06-28 13:46:55.458 1361-1361/? E/Hyphenator: error loading hyphenation /system/usr/hyphen-data/hyph-eu.pat.txt
                                             java.io.FileNotFoundException: /system/usr/hyphen-data/hyph-eu.pat.txt: open failed: ENOENT (No such file or directory)
                                                 at libcore.io.IoBridge.open(IoBridge.java:452)
                                                 at libcore.io.IoUtils$FileReader.<init>(IoUtils.java:207)
                                                 at libcore.io.IoUtils.readFileAsString(IoUtils.java:114)
                                                 at android.text.Hyphenator.loadHyphenator(Hyphenator.java:96)
                                                 at android.text.Hyphenator.init(Hyphenator.java:154)
                                                 at com.android.internal.os.ZygoteInit.preloadTextResources(ZygoteInit.java:207)
                                                 at com.android.internal.os.ZygoteInit.preload(ZygoteInit.java:186)
                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593)
                                              Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
                                                 at libcore.io.Posix.open(Native Method)
                                                 at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
                                                 at libcore.io.IoBridge.open(IoBridge.java:438)
                                                 at libcore.io.IoUtils$FileReader.<init>(IoUtils.java:207) 
                                                 at libcore.io.IoUtils.readFileAsString(IoUtils.java:114) 
                                                 at android.text.Hyphenator.loadHyphenator(Hyphenator.java:96) 
                                                 at android.text.Hyphenator.init(Hyphenator.java:154) 
                                                 at com.android.internal.os.ZygoteInit.preloadTextResources(ZygoteInit.java:207) 
                                                 at com.android.internal.os.ZygoteInit.preload(ZygoteInit.java:186) 
                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593) 
06-28 13:46:55.458 1361-1361/? E/Hyphenator: error loading hyphenation /system/usr/hyphen-data/hyph-hu.pat.txt
                                             java.io.FileNotFoundException: /system/usr/hyphen-data/hyph-hu.pat.txt: open failed: ENOENT (No such file or directory)
                                                 at libcore.io.IoBridge.open(IoBridge.java:452)
                                                 at libcore.io.IoUtils$FileReader.<init>(IoUtils.java:207)
                                                 at libcore.io.IoUtils.readFileAsString(IoUtils.java:114)
                                                 at android.text.Hyphenator.loadHyphenator(Hyphenator.java:96)
                                                 at android.text.Hyphenator.init(Hyphenator.java:154)
                                                 at com.android.internal.os.ZygoteInit.preloadTextResources(ZygoteInit.java:207)
                                                 at com.android.internal.os.ZygoteInit.preload(ZygoteInit.java:186)
                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593)
                                              Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
                                                 at libcore.io.Posix.open(Native Method)
                                                 at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
                                                 at libcore.io.IoBridge.open(IoBridge.java:438)
                                                 at libcore.io.IoUtils$FileReader.<init>(IoUtils.java:207) 
                                                 at libcore.io.IoUtils.readFileAsString(IoUtils.java:114) 
                                                 at android.text.Hyphenator.loadHyphenator(Hyphenator.java:96) 
                                                 at android.text.Hyphenator.init(Hyphenator.java:154) 
                                                 at com.android.internal.os.ZygoteInit.preloadTextResources(ZygoteInit.java:207) 
                                                 at com.android.internal.os.ZygoteInit.preload(ZygoteInit.java:186) 
                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593) 
06-28 13:46:55.459 1361-1361/? E/Hyphenator: error loading hyphenation /system/usr/hyphen-data/hyph-hy.pat.txt

You would think that that Could not find software fallback module!? would be something I could google for. But I don't see anything...

Andy Jones
  • 1,074
  • 1
  • 10
  • 21
  • I have the exact same issue, running Ubuntu 16.10, since updating on Tuesday morning. I've also tried removing everything and reinstalling, googling various errors including this one, killing and restarting adb, but nothing seems to work. I've also tried searching for the "Waiting for service SurfaceFlinger..." which seems to loop forever, no luck though. – Tom H. Jun 29 '17 at 08:15
  • Your mention of the upgrade being specifically to version 2.3.3 made me think to try rolling back to 2.3.2. I removed everything again, only this time downloaded the older version of Android Studio from here: https://developer.android.com/studio/archive.html Unfortunately that didn't work either. – Tom H. Jun 29 '17 at 08:52

1 Answers1

1

I've got this working now.

TL;DR:

  1. DO NOT expect Android Studio to hold your hand WRT the emulator. It will screw up some of the time. It will hide error messages. It might be wise to learn to talk to the emulator directly.
  2. There is a bug in this version of Android Studio -- see this question.
  3. This answer fixes another new bug (at least, new bug for me). It also shows you how to get more control over your virtual devices.

Finding the Actual Errors

First, you need to see the actual error that is causing the emulator to fail. It's likely that Studio is not showing you that; you need to run the emulator directly from the command line. If you have a virtual device called "foo" then this is just emulator @foo, but likely your devices all have names like NEXUS_XL_BLARG_23_SKIDOO. I found it best to rename them to something typeable in the Studio 'AVD' GUI.

If you can't run the emulator command, then you will need to fix your environment variables. I have this in my profile:

export ANDROID_HOME=${HOME}/Android/Sdk
export PATH=${PATH}:${ANDROID_HOME}/tools
export PATH=${PATH}:${ANDROID_HOME}/platform-tools
export PATH=${PATH}:${ANDROID_HOME}/tools/bin
export PATH=${PATH}:/usr/local/lib/jdk/bin
export JAVA_HOME=/usr/local/lib/jdk 

(Yes, I have the JDK installed separately. I have no idea whether that is important. Sorry.)

Google's help page for the emulator command is here.

Deal With the 2.3.3 Error

As noted in this question.

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

andy@zarkov[~]%: which emulator
/home/andy/Android/Sdk/tools/emulator

andy@zarkov[~]%: cd /home/andy/Android/Sdk/tools

Deal With the Other Problems You Didn't Know You Had

In my case it turns out that I don't have the right graphic drivers installed to use the emulator with KVM. Now I'm running the emulator from the command line, I can see that. Didn't know before.

andy@zarkov[~/Android/Sdk/tools]%: emulator @latest_kvm            
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
X Error of failed request:  GLXBadContext
  Major opcode of failed request:  155 (GLX)
  Minor opcode of failed request:  6 (X_GLXIsDirect)
  Serial number of failed request:  36
  Current serial number in output stream:  35
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  155 (GLX)
  Minor opcode of failed request:  24 (X_GLXCreateNewContext)
  Value in failed request:  0x0
  Serial number of failed request:  38
  Current serial number in output stream:  39
QObject::~QObject: Timers cannot be stopped from another thread
[1]    30486 segmentation fault  emulator @latest_kvm

And it looks as if the goalposts have moved for the software graphic driver and there is another little bug to deal with, which is handled by this SO answer very nicely:

(139) andy@zarkov[~/Android/Sdk/tools]%: emulator @later_soft
ERROR: Invalid GPU mode 'mesa', use one of: on off host guest
Andy Jones
  • 1,074
  • 1
  • 10
  • 21
  • 1
    For me it turned out the only solution was to install proprietary graphics drivers and run it in hardware graphics mode. – Tom H. Jun 29 '17 at 10:22