升级到ADS 2.3.3后如何运行虚拟设备?

时间:2017-06-28 13:53:52

标签: android-studio intellij-idea adb

一切正常,直到我升级。但现在我无法启动虚拟设备。这是在Debian Jessie上的。

我现在已经擦掉所有东西并重新安装了。我有同样的问题:取决于我如何配置我的虚拟设备,我得到(1)什么都没有或(2)空白模拟'电话窗口和很多错误。见下文。

有关如何前进的任何建议吗?我一直试图让这一整天重新安装,什么也没有。

(注意:我已经尝试adb kill-server; adb start-server。)

我说我已经擦掉了所有东西,但也许我错过了一些东西。我完全删除了:

* $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)

从头再次安装后,从命令行运行studio.sh,然后尝试启动虚拟设备---这就是我在命令行上看到的内容:

[  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 

以下是我在ADS的“Android设备监视器”屏幕中看到的内容(只是大量错误滚动列表的开头。我的滤镜设置仅在此处显示错误):

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

你会认为Could not find software fallback module!?是我可以google的东西。但是我没有看到任何东西......

1 个答案:

答案 0 :(得分:1)

我现在有这个工作了。

TL; DR:

  1. 不要希望Android Studio握住你的手WRT模拟器。它会在某些时候搞砸了。它将隐藏错误消息。学会直接与模拟器交谈可能是明智的。
  2. 此版本的Android Studio中存在错误 - 请参阅this问题。
  3. This回答修复了另一个新错误(至少是我的新错误)。它还向您展示了如何更好地控制虚拟设备。
  4. 查找实际错误

    首先,您需要查看导致模拟器失败的实际错误。 Studio很可能没有向您展示;您需要直接从命令行运行模拟器。如果您有一个名为“foo”的虚拟设备,那么这只是emulator @foo,但您的设备可能都有NEXUS_XL_BLARG_23_SKIDOO等名称。我发现最好将它们重命名为可在Studio'AVD'GUI中输入的内容。

    如果无法运行emulator命令,则需要修复环境变量。我在我的个人资料中有这个:

    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 
    

    (是的,我已经单独安装了JDK。我不知道这是否重要。抱歉。)

    Google emulator命令的帮助页面为here

    处理2.3.3错误

    this问题所述。

    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
    

    处理您不知道的其他问题

    在我的情况下,事实证明我没有安装正确的图形驱动程序来使用带有KVM的模拟器。现在我从命令行运行模拟器,我可以看到。以前不知道。

    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
    

    看起来好像球门柱移动了软件图形驱动程序并且还有另一个小问题需要处理,由this处理。所以回答非常好:

    (139) andy@zarkov[~/Android/Sdk/tools]%: emulator @later_soft
    ERROR: Invalid GPU mode 'mesa', use one of: on off host guest