mapbox / mapbox-maps-flutter

Interactive, thoroughly customizable maps for Flutter powered by Mapbox Maps SDK
https://www.mapbox.com/mobile-maps-sdk
Other
245 stars 93 forks source link

How to fix this exception? no ES 3 support? #504

Closed ember11498 closed 3 weeks ago

ember11498 commented 3 weeks ago

I got this error:

E/EGL_emulation(18317): eglCreateContext: EGL_BAD_CONFIG: no ES 3 support
E/EGL_emulation(18317): tid 18512: eglCreateContext(1682): error 0x3005 (EGL_BAD_CONFIG)
E/AndroidRuntime(18317): FATAL EXCEPTION: MapboxRenderThread
E/AndroidRuntime(18317): Process: com.example.temp, PID: 18317
E/AndroidRuntime(18317): java.lang.IllegalStateException: OpenGL ES 3.0 context could not be created
E/AndroidRuntime(18317):    at com.mapbox.maps.renderer.egl.EGLCore.prepareEgl(EGLCore.kt:89)
E/AndroidRuntime(18317):    at com.mapbox.maps.renderer.MapboxRenderThread.checkEglConfig(MapboxRenderThread.kt:246)
E/AndroidRuntime(18317):    at com.mapbox.maps.renderer.MapboxRenderThread.setUpRenderThread(MapboxRenderThread.kt:207)
E/AndroidRuntime(18317):    at com.mapbox.maps.renderer.MapboxRenderThread.prepareRenderFrame(MapboxRenderThread.kt:459)
E/AndroidRuntime(18317):    at com.mapbox.maps.renderer.MapboxRenderThread.processAndroidSurface$sdk_release(MapboxRenderThread.kt:542)
E/AndroidRuntime(18317):    at com.mapbox.maps.renderer.MapboxRenderThread$onSurfaceCreated$1$1$1.invoke(MapboxRenderThread.kt:559)
E/AndroidRuntime(18317):    at com.mapbox.maps.renderer.MapboxRenderThread$onSurfaceCreated$1$1$1.invoke(MapboxRenderThread.kt:558)
E/AndroidRuntime(18317):    at com.mapbox.maps.renderer.RenderHandlerThread.postDelayed$lambda$1$lambda$0(RenderHandlerThread.kt:39)
E/AndroidRuntime(18317):    at com.mapbox.maps.renderer.RenderHandlerThread.$r8$lambda$YB_YSeUrlxhPn95u2dpCGDwyAyU(Unknown Source:0)
E/AndroidRuntime(18317):    at com.mapbox.maps.renderer.RenderHandlerThread$$ExternalSyntheticLambda0.run(Unknown Source:2)
E/AndroidRuntime(18317):    at android.os.Handler.handleCallback(Handler.java:938)
E/AndroidRuntime(18317):    at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(18317):    at android.os.Looper.loop(Looper.java:223)
E/AndroidRuntime(18317):    at android.os.HandlerThread.run(HandlerThread.java:67)
I/Process (18317): Sending signal. PID: 18317 SIG: 9

how can I fix it?

my code looks like:

  @override
  Widget build(BuildContext context) {
    return MapWidget(
      key: const ValueKey("mapWidget_Event_Location"),
      cameraOptions: CameraOptions(
        center: Point(
          coordinates: Position(-10.173944601588289, 39.74879879604326),
        ).toJson(),
        zoom: 12,
      ),
      styleUri: mapBoxStyle,
      onMapCreated: _onMapCreated,
      onTapListener: _onTap,
      onScrollListener: _onScrollListener,
      onMapIdleListener: _onMapIdle,
    );
  }
ember11498 commented 3 weeks ago

I tried many other emulators and couldnt make it work. I always get the same error. Seems my emulators dont support OpenGL ES 3.0 context? What should I do?

baleboy commented 3 weeks ago

This seems to be an issue with your emulator config rather than Mapbox. Can you share more details about what emulator you use and on what platform?

ember11498 commented 3 weeks ago

@baleboy thank you for your reply. Following I'll show you several pictures of my emulator:

Note:my computer is omen 15, windows.

image

image

image

image

image

image

image

image

image

image

image

image

image

image

ember11498 commented 3 weeks ago

@baleboy just one more thing. I remember when I went to location in my emulator a map would show up. This was months ago. But now it seems it doesn't even render the map and it's all blank if you see the picture I sent you in the location setting on the emulator

ember11498 commented 3 weeks ago

@baleboy I will try this solution when I arrieve home (in 8 hours).

https://stackoverflow.com/questions/77612277/android-emulator-location-map-is-not-loading

Basically they say "it can be resolved by updating the Android SDK Platform-Tools and Android Emulator."

ember11498 commented 3 weeks ago

@baleboy you can close. issue is fixed after i updated android SDK tools

baleboy commented 3 weeks ago

Great, thanks for the follow-up!