Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not choose an EGL configuration. #22671

Closed
bbozhidarov opened this issue Oct 4, 2018 · 8 comments
Closed

Could not choose an EGL configuration. #22671

bbozhidarov opened this issue Oct 4, 2018 · 8 comments
Labels
c: crash Stack traces logged to the console e: device-specific Only manifests on certain devices engine flutter/engine repository. See also e: labels. platform-android Android applications specifically

Comments

@bbozhidarov
Copy link

bbozhidarov commented Oct 4, 2018

I'm having trouble running my application on Android. I use Bluestacks v3 (Client version - 3.56.76.1867, Engine version - 2.56.77.1326) and Android Studio v3.1.4. I was able to run it on the Android Studio emulator with both these configurations:

  • Nexus 4 API 23 (Android 6.0)
  • Nexus 6 API 22 (Android 5.1)

This is the error that I get:

Launching lib\main.dart on SAMSUNG SM N900A in debug mode...
Initializing gradle...
Resolving dependencies...
Running 'gradlew assembleDebug'...
Built build\app\outputs\apk\debug\app-debug.apk.
E/flutter ( 6795): [ERROR:flutter/shell/platform/android/android_context_gl.cc(165)] Could not choose an EGL configuration.
E/flutter ( 6795): [ERROR:flutter/shell/platform/android/android_context_gl.cc(53)] EGL Error: EGL_SUCCESS (12288)
F/flutter ( 6795): [FATAL:flutter/shell/platform/android/platform_view_android.cc(28)] Check failed: android_surface_. Could not create an OpenGL, Vulkan or Software surface to setup rendering.
E/flutter ( 6841): [ERROR:flutter/shell/platform/android/android_context_gl.cc(165)] Could not choose an EGL configuration.
E/flutter ( 6841): [ERROR:flutter/shell/platform/android/android_context_gl.cc(53)] EGL Error: EGL_SUCCESS (12288)
F/flutter ( 6841): [FATAL:flutter/shell/platform/android/platform_view_android.cc(28)] Check failed: android_surface_. Could not create an OpenGL, Vulkan or Software surface to setup rendering.
E/flutter ( 6865): [ERROR:flutter/shell/platform/android/android_context_gl.cc(165)] Could not choose an EGL configuration.
E/flutter ( 6865): [ERROR:flutter/shell/platform/android/android_context_gl.cc(53)] EGL Error: EGL_SUCCESS (12288)
F/flutter ( 6865): [FATAL:flutter/shell/platform/android/platform_view_android.cc(28)] Check failed: android_surface_. Could not create an OpenGL, Vulkan or Software surface to setup rendering.

That's the output of 'flutter doctor -v':

[√] Flutter (Channel beta, v0.7.3, on Microsoft Windows [Version 10.0.17134.285], locale en-US)
    • Flutter version 0.7.3 at C:\src\flutter-0.7.3\flutter
    • Framework revision 3b309bda07 (5 weeks ago), 2018-08-28 12:39:24 -0700
    • Engine revision af42b6dc95
    • Dart version 2.1.0-dev.1.0.flutter-ccb16f7282

[√] Android toolchain - develop for Android devices (Android SDK 28.0.0)
    • Android SDK at C:\Users\bbozhidarov\AppData\Local\Android\Sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.0
    • ANDROID_HOME = C:\Users\bbozhidarov\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
    • All Android licenses accepted.

[√] Android Studio (version 3.1)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 28.0.1
    • Dart plugin version 173.4700
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)

[!] IntelliJ IDEA Community Edition (version 2018.1)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.1.6
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
    • For information about installing plugins, see
      https://flutter.io/intellij-setup/#installing-the-plugins

[!] VS Code, 64-bit edition (version 1.25.1)
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[√] Connected devices (1 available)
    • SAMSUNG SM N900A • emulator-5554 • android-x86 • Android 4.4.2 (API 19)

! Doctor found issues in 2 categories.

Any help will be very much appreciated.

@zoechi zoechi added c: crash Stack traces logged to the console e: device-specific Only manifests on certain devices platform-android Android applications specifically engine flutter/engine repository. See also e: labels. labels Oct 4, 2018
@mklim
Copy link
Contributor

mklim commented Oct 8, 2018

Thanks for the issue report @bbozhidarov.

In general that stack trace means that the engine failed to find any GL framebuffer configs that match the attributes it needs to render.

Part of your comment isn't clear to me, sorry. Is the app working on the Nexus Android Studio emulators and crashing on Bluestacks only?

Are you also seeing any of the example apps crash when they're run? If not, could you provide some sample code that reproduces this crash?

Thanks!

@big-hippo
Copy link

big-hippo commented Oct 9, 2018

I have same problem, there are logcat logs:

10-09 11:28:30.092 525-1122/system_process I/ActivityManager: Start proc com.whatever.apptest for activity com.whatever.apptest/.MainActivity: pid=2232 uid=10035 gids={50035, 3003}
10-09 11:28:30.112 525-567/system_process W/NetworkManagementSocketTagger: setKernelCountSet(10035, 1) failed with errno -13
10-09 11:28:30.142 2232-2238/? D/dalvikvm: Debugger has detached; object registry had 3 entries
10-09 11:28:30.502 2232-2232/? D/dalvikvm: Trying to load lib /data/app-lib/com.whatever.apptest-1/libflutter.so 0x94fa8488
    Added shared lib /data/app-lib/com.whatever.apptest-1/libflutter.so 0x94fa8488
10-09 11:28:30.502 2232-2232/? I/dalvikvm: Could not find method android.view.Window.setStatusBarColor, referenced from method io.flutter.app.FlutterActivityDelegate.onCreate
10-09 11:28:30.522 2232-2232/? W/dalvikvm: VFY: unable to resolve virtual method 202: Landroid/view/Window;.setStatusBarColor (I)V
10-09 11:28:30.522 2232-2232/? D/dalvikvm: VFY: replacing opcode 0x6e at 0x0013
10-09 11:28:30.532 2232-2232/? W/dalvikvm: VFY: unable to find class referenced in signature (Landroid/view/WindowInsets;)
10-09 11:28:30.532 2232-2232/? I/dalvikvm: Could not find method android.view.WindowInsets.getSystemWindowInsetTop, referenced from method io.flutter.view.FlutterView.onApplyWindowInsets
10-09 11:28:30.532 2232-2232/? W/dalvikvm: VFY: unable to resolve virtual method 206: Landroid/view/WindowInsets;.getSystemWindowInsetTop ()I
10-09 11:28:30.532 2232-2232/? D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002
10-09 11:28:30.532 2232-2232/? I/dalvikvm: Could not find method io.flutter.view.FlutterView.requestUnbufferedDispatch, referenced from method io.flutter.view.FlutterView.onTouchEvent
10-09 11:28:30.532 2232-2232/? W/dalvikvm: VFY: unable to resolve virtual method 951: Lio/flutter/view/FlutterView;.requestUnbufferedDispatch (Landroid/view/MotionEvent;)V
10-09 11:28:30.532 2232-2232/? D/dalvikvm: VFY: replacing opcode 0x6e at 0x000e
10-09 11:28:30.652 2232-2232/? D/libEGL: loaded /system/lib/egl/libEGL_adreno.so
10-09 11:28:30.682 2232-2232/? D/libEGL: loaded /system/lib/egl/libGLESv1_CM_adreno.so
    loaded /system/lib/egl/libGLESv2_adreno.so
10-09 11:28:30.702 2232-2232/? E/flutter: [ERROR:flutter/shell/platform/android/android_context_gl.cc(165)] Could not choose an EGL configuration.
    [ERROR:flutter/shell/platform/android/android_context_gl.cc(53)] EGL Error: EGL_SUCCESS (12288)
10-09 11:28:30.702 2232-2232/? A/flutter: [FATAL:flutter/shell/platform/android/platform_view_android.cc(28)] Check failed: android_surface_. Could not create an OpenGL, Vulkan or Software surface to setup rendering.
10-09 11:28:30.702 2232-2232/? A/libc: Fatal signal 6 (SIGABRT) at 0x000008b8 (code=-6), thread 2232 (hatever.apptest)

@mklim
Copy link
Contributor

mklim commented Oct 9, 2018

Thanks for the additional report @big-hippo! What device and android version are you seeing this happen on?

@mklim mklim added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Oct 9, 2018
@big-hippo
Copy link

I test it for many x86 android emulators, all emulators base on virtualbox (except genymotion) throw these.
it looks like some libs which flutter depends on are missing.

@mklim
Copy link
Contributor

mklim commented Oct 11, 2018

Thanks for the extra info. Yeah, it sounds like there's something unexpected about the OpenGL emulation.

I think it should be possible to work around this locally in the meantime with flutter run --enable-software-rendering. That flag disables OpenGL and falls back to Skia's rendering instead.

@mklim mklim self-assigned this Oct 11, 2018
@mklim mklim removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Oct 11, 2018
@zoechi zoechi added this to the Goals milestone Feb 18, 2019
@mklim mklim removed their assignment Jun 11, 2019
@eseidelGoogle
Copy link
Contributor

We've had a whole host of these reports over the years. We probably could use something more systematic to collect debugging information from these configurations as to why they're failing to start.

I'm tempted to just lump this into #15451.

@ritvij-saxena
Copy link

I am having the same original issue as mentioned by the author @bbozhidarov.

flutter doctor -v

[√] Flutter (Channel stable, 1.20.3, on Microsoft Windows [Version 10.0.19041.804], locale en-US)
• Flutter version 1.20.3 at D:\Flutter Course\flutter_windows_v1.0.0-stable\flutter
• Framework revision 216dee6 (6 months ago), 2020-09-01 12:24:47 -0700
• Engine revision d1bc06f032
• Dart version 2.9.2

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at C:\Users\ritvi\AppData\Local\Android\Sdk
• Platform android-30, build-tools 30.0.2
• Java binary at: D:\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
• All Android licenses accepted.

[√] Android Studio (version 4.0)
• Android Studio at D:\Android Studio
• Flutter plugin version 49.0.2
• Dart plugin version 193.7547
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[!] IntelliJ IDEA Community Edition (version 2019.3)
• IntelliJ at D:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.3
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
• For information about installing plugins, see
https://flutter.dev/intellij-setup/#installing-the-plugins

[!] VS Code (version 1.53.2)
• VS Code at C:\Users\ritvi\AppData\Local\Programs\Microsoft VS Code
X Flutter extension not installed; install from
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[√] Connected device (1 available)
• AOSP on IA Emulator (mobile) • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)

! Doctor found issues in 2 categories.

After using the command flutter run --enable-software-rendering

Logs

Using software rendering with device AOSP on IA Emulator. You may get better performance with hardware mode by configuring hardware rendering for your device.
Launching lib\main.dart on AOSP on IA Emulator in debug mode...
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 25.5s
√ Built build\app\outputs\flutter-apk\app-debug.apk.
Installing build\app\outputs\flutter-apk\app.apk... 2.6s
Waiting for AOSP on IA Emulator to report its views... 16ms
D/HostConnection( 4015): createUnique: call
E/ ( 4015): connect: failed to connect to opengles pipe
E/ ( 4015): pipe error: fd -1 errno 12
E/HostConnection( 4015): Failed to connect to host (QemuPipeStream)!!!
E/gralloc_ranchu( 4015): gralloc: Failed to get host connection
W/GraphicBufferMapper( 4015): importBuffer(0xe862b9e0) failed: 2
E/GraphicBuffer( 4015): unflatten: registerBuffer failed: Unknown error -2 (2)
E/Surface ( 4015): dequeueBuffer: IGraphicBufferProducer::requestBuffer failed: 2
E/EGL_emulation( 4015): tid 4061: init(398): error 0x3003 (EGL_BAD_ALLOC)
E/EGL_emulation( 4015): tid 4061: eglCreateWindowSurface(1056): error 0x3003 (EGL_BAD_ALLOC)
F/OpenGLRenderer( 4015): Failed to create EGLSurface for window 0xcbab7808, eglErr = EGL_BAD_ALLOC
F/libc ( 4015): Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 4061 (RenderThread), pid 4015 (resssdriverlite)


Build fingerprint: 'google/sdk_gphone_x86_arm/generic_x86_arm:9/PSR1.180720.117/5875966:user/release-keys'
Revision: '0'
ABI: 'x86'
pid: 4015, tid: 4061, name: RenderThread >>> <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
Abort message: 'Failed to create EGLSurface for window 0xcbab7808, eglErr = EGL_BAD_ALLOC'
eax 00000000 ebx 00000faf ecx 00000fdd edx 00000006
edi 00000faf esi c697f28c
ebp c697f258 esp c697f1e8 eip ed0a1b39
backtrace:
#00 pc 00000b39 [vdso:ed0a1000] (__kernel_vsyscall+9)
#1 pc 0001fdf8 /system/lib/libc.so (syscall+40)
#2 pc 00022ed3 /system/lib/libc.so (abort+115)
#3 pc 00006c84 /system/lib/liblog.so (__android_log_assert+292)
#4 pc 0054d265 /system/lib/libhwui.so (android::uirenderer::renderthread::EglManager::createSurface(ANativeWindow*, bool)+325)
#5 pc 0054610d /system/lib/libhwui.so (android::uirenderer::skiapipeline::SkiaOpenGLPipeline::setSurface(android::Surface*, android::uirenderer::renderthread::SwapBehavior, android::uirenderer::renderthre
ad::ColorMode)+93)
#6 pc 0054a68a /system/lib/libhwui.so (android::uirenderer::renderthread::CanvasContext::setSurface(android::spandroid::Surface&&)+106)
#7 pc 0054ffba /system/lib/libhwui.so (_ZNSt3__110__function6__funcIZN7android10uirenderer12renderthread11RenderProxy10initializeERKNS2_2spINS2_7SurfaceEEEE3$_6NS_9allocatorISB_EEFvvEEclEv$64c930c5b4139b4
fd99ae4f62fbd45a8+42)
#8 pc 004fd532 /system/lib/libhwui.so (android::uirenderer::WorkQueue::process()+242)
#9 pc 000c45ba /system/lib/libhwui.so (android::uirenderer::renderthread::RenderThread::threadLoop()+314)
#10 pc 0000e616 /system/lib/libutils.so (android::Thread::_threadLoop(void*)+326)
#11 pc 0000df76 /system/lib/libutils.so (thread_data_t::trampoline(thread_data_t const*)+246)
#12 pc 0008f065 /system/lib/libc.so (__pthread_start(void*)+53)
#13 pc 0002485b /system/lib/libc.so (__start_thread+75)
Lost connection to device.
Syncing files to device AOSP on IA Emulator...
Could not update files on device: HttpException: Connection closed before full header was received, uri = http://127.0.0.1:60835/Hx--1dsaYT4=/
Syncing files to device AOSP on IA Emulator...

Emulator Details

Name: Pixel_3a_API_28
CPU/ABI: Google Play Intel Atom (x86)
Target: google_apis_playstore [Google Play] (API level 28)
Skin: pixel_3a
SD Card: 512M
fastboot.chosenSnapshotFile:
runtime.network.speed: full
hw.accelerometer: yes
hw.device.name: pixel_3a
hw.lcd.width: 1080
hw.initialOrientation: Portrait
image.androidVersion.api: 28
tag.id: google_apis_playstore
hw.mainKeys: no
hw.camera.front: emulated
avd.ini.displayname: Pixel 3a API 28
hw.gpu.mode: auto
hw.ramSize: 1536
PlayStore.enabled: true
fastboot.forceColdBoot: no
hw.cpu.ncore: 4
hw.keyboard: yes
hw.sensors.proximity: yes
hw.dPad: no
hw.lcd.height: 2220
vm.heapSize: 256
skin.dynamic: yes
hw.device.manufacturer: Google
hw.gps: yes
hw.audioInput: yes
image.sysdir.1: system-images\android-28\google_apis_playstore\x86
showDeviceFrame: yes
hw.camera.back: virtualscene
AvdId: Pixel_3a_API_28
hw.lcd.density: 440
hw.arc: false
hw.device.hash2: MD5:0e6953ebf01bdc6b33a2f54746629c50
fastboot.forceChosenSnapshotBoot: no
fastboot.forceFastBoot: yes
hw.trackBall: no
hw.battery: yes
hw.sdCard: yes
tag.display: Google Play
runtime.network.latency: none
disk.dataPartition.size: 6442450944
hw.sensors.orientation: yes
avd.ini.encoding: UTF-8
hw.gpu.enabled: yes

@github-actions
Copy link

github-actions bot commented Aug 5, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: crash Stack traces logged to the console e: device-specific Only manifests on certain devices engine flutter/engine repository. See also e: labels. platform-android Android applications specifically
Projects
None yet
Development

No branches or pull requests

6 participants