In our current application, the user can see POIs around a location with a listing or a map. He can also select the location around which he wants to see POIs using a map in a bottom sheet.
Because of this, we may have two maps visible on screen and they can overlap. This triggers some weird rendering issues where the data of the background map is drawn over the bottom sheet one, and eventually the app crashes.
Here are two walkthrough in our app to explain the context and how the issue occurs:

- Show the POIs map
- Hide it to show the bottom sheet without issue
- Show the bottom sheet map
- Show the two together
- Crash

- Show the POIs map
- Show the bottom sheet map
- The background map is drawn over the bottom sheet one
- Hide and show the bottom sheet map
- Crash
Here is the stacktrace:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: our.app.package, PID: 26446
java.lang.Error: eglSwapBuffers() failed
at com.mapbox.mapboxsdk.maps.NativeMapView.nativeRender(Native Method)
at com.mapbox.mapboxsdk.maps.NativeMapView.render(NativeMapView.java:179)
at com.mapbox.mapboxsdk.maps.MapView.onDraw(MapView.java:407)
at android.view.View.draw(View.java:17185)
at android.view.View.updateDisplayListIfDirty(View.java:16167)
at android.view.View.draw(View.java:16951)
at android.view.ViewGroup.drawChild(ViewGroup.java:3727)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3513)
[...]
This seems related to #6647 and maybe #8725
Device:
Android 7.1.2
Nexus 5X
Mapbox SDK version:
Mapbox 5.0.1, upgraded to 5.1.0 and still getting crashes
Steps to trigger behavior
- Have a map view
- Open a bottom sheet containing another map view on top of the other one
Expected behavior
The bottom sheet map view should render above the other one without problem.
Actual behavior
The map view in the background is rendered on top of the bottom sheet one and the app crashes.
In our current application, the user can see POIs around a location with a listing or a map. He can also select the location around which he wants to see POIs using a map in a bottom sheet.
Because of this, we may have two maps visible on screen and they can overlap. This triggers some weird rendering issues where the data of the background map is drawn over the bottom sheet one, and eventually the app crashes.
Here are two walkthrough in our app to explain the context and how the issue occurs:
Here is the stacktrace:
This seems related to #6647 and maybe #8725
Device:
Android 7.1.2
Nexus 5X
Mapbox SDK version:
Mapbox 5.0.1, upgraded to 5.1.0 and still getting crashes
Steps to trigger behavior
Expected behavior
The bottom sheet map view should render above the other one without problem.
Actual behavior
The map view in the background is rendered on top of the bottom sheet one and the app crashes.