模拟器无法加载“libGLES_emulation”驱动程序

Posted

技术标签:

【中文标题】模拟器无法加载“libGLES_emulation”驱动程序【英文标题】:Emulators can't load "libGLES_emulation" driver 【发布时间】:2020-01-10 07:53:38 【问题描述】:

我正在使用Google's guide 设置FirebaseUI,但我突然遇到一个错误,我似乎找不到解决方案。我很确定这与我的 gradle 有关,因为我尝试使用我的手机而不是 AVD 和其他模拟器来评论我的 Java 文件中的更改,但无济于事。我已经包含了我在运行控制台、清单和 gradles 中得到的内容。如果您需要更多信息,请告诉我。谢谢!


编辑:对于那些有同样问题的人,我想我通过更新 API Q 模拟器上的 Google Play 服务来修复它(你必须先登录到 Google Play),然后我在应用程序中添加了以下内容级等级:

android 
     ...
     compileOptions 
         ...
         sourceCompatibility = 1.8
         targetCompatibility = 1.8
         ...
     
     ...

我不知道它是如何工作的,但我希望它也适用于你。


运行(仅限冲突)

...
W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
...
W/libc: Unable to set property "qemu.gles" to "1": connection failed; errno=13 (Permission denied)
E/vndksupport: Could not load /vendor/lib/egl/libGLES_emulation.so from sphal namespace: dlopen failed: library "/vendor/lib/egl/libGLES_emulation.so" not found.
E/libEGL: load_driver(/vendor/lib/egl/libGLES_emulation.so): unknown
W/RenderThread: type=1400 audit(0.0:4480): avc: denied  write  for name="property_service" dev="tmpfs" ino=8377 scontext=u:r:untrusted_app_27:s0:c119,c256,c512,c768 tcontext=u:object_r:property_socket:s0 tclass=sock_file permissive=0
...
W/xample.litloca: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection)
    Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection)
...
W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
...
W/Gralloc3: mapper 3.x is not supported

运行(完整)

09/07 19:52:53: Launching 'app' on Pixel 2 API Q.
$ adb shell am start -n "com.example.litlocal/com.example.litlocal.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Waiting for process to come online...
Connected to process 14608 on device 'Pixel_2_API_Q [emulator-5554]'.
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/xample.litloca: The ClassLoaderContext is a special shared library.
I/xample.litloca: The ClassLoaderContext is a special shared library.
W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
I/FirebaseAuth: [FirebaseAuth:] Preparing to create service connection to gms implementation
V/FA: Registered activity lifecycle callback
I/FirebaseInitProvider: FirebaseApp initialization successful
D/OpenGLRenderer: Skia GL Pipeline
D/libEGL: Emulator has host GPU support, qemu.gles is set to 1.
W/libc: Unable to set property "qemu.gles" to "1": connection failed; errno=13 (Permission denied)
E/vndksupport: Could not load /vendor/lib/egl/libGLES_emulation.so from sphal namespace: dlopen failed: library "/vendor/lib/egl/libGLES_emulation.so" not found.
E/libEGL: load_driver(/vendor/lib/egl/libGLES_emulation.so): unknown
D/libEGL: loaded /vendor/lib/egl/libEGL_emulation.so
D/libEGL: loaded /vendor/lib/egl/libGLESv1_CM_emulation.so
W/RenderThread: type=1400 audit(0.0:4449): avc: denied  write  for name="property_service" dev="tmpfs" ino=8377 scontext=u:r:untrusted_app_27:s0:c119,c256,c512,c768 tcontext=u:object_r:property_socket:s0 tclass=sock_file permissive=0
D/libEGL: loaded /vendor/lib/egl/libGLESv2_emulation.so
V/FA: onActivityCreated
W/xample.litloca: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection)
W/xample.litloca: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection)
D/: HostConnection::get() New Host Connection established 0xdc721500, tid 14666
D/: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_dma_v1 ANDROID_EMU_host_composition_v1 GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_gles_max_version_3_0 
D/OpenGLRenderer: Swap behavior 1
W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
D/OpenGLRenderer: Swap behavior 0
D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 0 0
D/EGL_emulation: eglCreateContext: 0xdc7124e0: maj 3 min 0 rcv 3
D/EGL_emulation: eglMakeCurrent: 0xdc7124e0: ver 3 0 (tinfo 0xdc708f60)
V/FA: Collection enabled
V/FA: App package, google app id: com.example.litlocal, 1:175514927228:android:47ec351c4609ff5c6609f9
W/Gralloc3: mapper 3.x is not supported
I/FA: App measurement is starting up, version: 18202
    To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
    To enable faster debug mode event logging run:
      adb shell setprop debug.firebase.analytics.app com.example.litlocal
D/FA: Debug-level message logging enabled
D/: createUnique: call
D/: HostConnection::get() New Host Connection established 0xdc721640, tid 14666
D/: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_dma_v1 ANDROID_EMU_host_composition_v1 GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_gles_max_version_3_0 
D/EGL_emulation: eglMakeCurrent: 0xdc7124e0: ver 3 0 (tinfo 0xdc708f60)
D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 1 0
I/xample.litloca: Background young concurrent copying GC freed 16987(4410KB) AllocSpace objects, 8(224KB) LOS objects, 78% free, 1696KB/7840KB, paused 6.401ms total 59.038ms
V/FA: Connecting to remote service
V/FA: Detected application was in foreground
V/FA: Session started, time: 27900964
D/FA: Setting user property (FE): _sid, 1567911177
V/FA: Connection attempt already in progress
I/FA: Tag Manager is not found and thus will not be used
D/FA: Logging event (FE): session_start(_s), Bundle[ga_event_origin(_o)=auto, ga_session_id(_sid)=1567911177]
V/FA: Connection attempt already in progress
V/FA: Connection attempt already in progress
V/FA: Activity resumed, time: 27900309
D/FA: Logging event (FE): screen_view(_vs), Bundle[ga_event_origin(_o)=auto, ga_screen_class(_sc)=MainActivity, ga_screen_id(_si)=8377598752693967695]
V/FA: Connection attempt already in progress
    Connection attempt already in progress
D/FA: Connected to remote service
V/FA: Processing queued up service tasks: 6
V/FA: Inactivity, disconnecting from the service

清单

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.litlocal">

    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.INTERNET" />

    <application
        android:name=".MyApplication"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">

        <activity
            android:name=".MainActivity"
            android:label="LitLocal">

            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <activity
            android:name=".CreateEventActivity"
            android:label="@string/create_event_activity_name"/>

        <activity
            android:name=".SetEventLocationActivity"
            android:label="@string/set_event_location_activity_name"/>

        <activity
            android:name=".LoginActivity"
            android:label="@string/login_activity_name"/>

    </application>

</manifest>

Gradle(项目)

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript 
    repositories 
        google()
        jcenter()

    
    dependencies 
        classpath 'com.android.tools.build:gradle:3.5.0'
        classpath 'com.google.gms:google-services:4.3.2'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    


allprojects 
    repositories 
        google()
        jcenter()
        mavenCentral()
    


task clean(type: Delete) 
    delete rootProject.buildDir

评分(应用)

apply plugin: 'com.android.application'

android 
    compileSdkVersion 28
    defaultConfig 
        applicationId "com.example.litlocal"
        minSdkVersion 22
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        resConfigs "en"
    
    buildTypes 
        release 
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        
    
    compileOptions 
        /*sourceCompatibility = 1.8
        targetCompatibility = 1.8*/
    


dependencies 
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'

    implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:8.2.1'
    implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-places-v8:0.9.0'

    implementation 'com.google.firebase:firebase-analytics:17.2.0'
    implementation 'com.google.firebase:firebase-auth:19.0.0'
    implementation 'com.firebaseui:firebase-ui-auth:4.1.0'
    implementation 'com.google.firebase:firebase-firestore:21.0.0'
    //implementation 'com.firebaseui:firebase-ui-database:5.1.0'

    implementation 'com.google.android.gms:play-services-auth:17.0.0'

    // Tentative for login
    //implementation 'com.squareup.picasso:picasso:2.71828'

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'


apply plugin: 'com.google.gms.google-services'

【问题讨论】:

您找到解决方案了吗?有类似的问题,我正在使用 AWS 和解析服务器 请检查我的编辑 【参考方案1】:

这对我有用:

android 
     ...
     compileOptions 
         ...
         sourceCompatibility = 1.8
         targetCompatibility = 1.8
         ...
     
     ...

【讨论】:

以上是关于模拟器无法加载“libGLES_emulation”驱动程序的主要内容,如果未能解决你的问题,请参考以下文章

运行模拟器/物理设备时无法加载图像

AVD Android模拟器 - 无法加载

Flutter登录Apple无法在iOS模拟器上运行(无限加载器)

android 2.2 模拟器 -- 无法加载 Wi-Fi 驱动程序

无法仅将本地 html 文件加载到设备上的 WKWebView 中(适用于模拟器)

Android Nexus 7 平板电脑模拟器无法加载正确的布局文件