emulator: WARNING: Could not initialize OpenglES emulation, using software renderer

后端 未结 8 2436
醉梦人生
醉梦人生 2020-12-14 06:51

What do these error messages mean from the Android emulator?

Starting emulator for AVD \'AVD\'
Failed to create Context 0x3005
could not get wglGetExtensions         


        
相关标签:
8条回答
  • 2020-12-14 07:40


    I think Gerd's solution was the most helpful.

    In case somebody stumbles across this, a more detailed and complete solution...

    The vanilla studio.sh starter-shell script sets an env-variable:

    LD_LIBRARY_PATH="$IDE_BIN_HOME:$LD_LIBRARY_PATH"
    

    that it then exports. The IDE_BIN_HOME is set by using the location of the studio.sh file (somewhere in the middle - usually [android-studio]/bin). When an emulator is launched through Studio->Manger->Tools->Manage AVDs this env-var is prefixed with android-SDK/tools/bin. Meaning when you start it standalone, you didn't set that env-var. Gerd's solution adds the lib to the system lib-search-path. Another approach would be to create a wrapper that takes care of this so that it's only set when needed and (possibly) other things are also set.

    #!/bin/bash
    export JAVA_HOME="/usr/lib/jvm/java-BLAH"
    export STUDIO_JDK="$JAVA_HOME"     #This is also used in studio.sh
    export IDE_BIN_HOME="/home/you/android-studio/bin"
    export Anroid_SDK="/home/you/android-sdk"
    export LD_LIBRARY_PATH="$Anroid_SDK/tools/lib:$IDE_BIN_HOME:$LD_LIBRARY_PATH"
    
    cd "$Anroid_SDK/tools"
    
    ./emulator64-x86 -avd AVD-NAME-1 -gpu on &
    ./emulator64-arm -avd AVD-NAME-2
    

    This is probably a bit overdone, but it's complete ;) Depending on Distro/Setup JAVA_HOME may be preset, so you could drop that line. If you constantly use the emulator, you could also add something like

    export LD_LIBRARY_PATH="[YOUR Studio PATH]/tools/lib:$LD_LIBRARY_PATH"
    

    to your .bashrc or .profile file.

    But to answer the actual question: It means that the emulator wasn't able to run (hardware-accel?) OpenGLES, and that it's using software routines to implement/emulate OpenGLES :D To enable emulator to find the desired lib, make sure you have proper (3D-Accel.?) graphic-card drivers installed, then choose one of the above (wrapper shell or (bash-)session-init settings).

    Note that newer versions of Android-Studio have forked out the SDK

    0 讨论(0)
  • 2020-12-14 07:45

    You have to play around with your android device specification like RAM, Heap other specification.

    It's hard to tell you which must be set to what. In my case I set RAM as 512 and Heap 128 to make it work.

    0 讨论(0)
提交回复
热议问题