Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Overlapping map views rendering crashes #9534

Closed

Description

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:

Walkthrough 1

  1. Show the POIs map
  2. Hide it to show the bottom sheet without issue
  3. Show the bottom sheet map
  4. Show the two together
  5. Crash

Walkthrough 2

  1. Show the POIs map
  2. Show the bottom sheet map
  3. The background map is drawn over the bottom sheet one
  4. Hide and show the bottom sheet map
  5. 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

  1. Have a map view
  2. 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.

Activity

  1. added
    Android
    on Jul 18, 2017
  2. tobrun commented on Jul 18, 2017

    @tobrun
    Member

    PR addressing this issue in #9538, would you be able to retest this with an upcoming 5.1.1 release?

  3. tobrun commented on Jul 19, 2017

    @tobrun
    Member

    The instant crash is gone. The rendering of the background map is still occurring on top of the bottom sheet one.

    The issue here is that the overlapping SurfaceViews are fighting for the z order and the underlying surfaceview wins. There are two workarounds:

    • Make the bottom use a texture view (this can be enabled through xml or MapboxMapOptions)
      - set Z order on top for the surfaceview in the bottom fragment drawer by ((SurfaceView) mapview.findViewById(R.id.surfaceView)).setZorderOnTop(true)

    @mesnault can you post a full stacktrace of that second crash?

  4. tobrun commented on Jul 24, 2017

    @tobrun
    Member

    adding here that 5.1.1 has shipped. I'm working now on reproducing the issue in #9534 (comment) but haven't been able to do so. To harden against future regressions I'm adding a similar setup to our testapp as shown in OP. Could you give some pointers on how yours setup differs from the setup in in #9592? This would help with reproducing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Android

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions