mapbox / mapbox-maps-android

Interactive, thoroughly customizable maps in native Android powered by vector tiles and OpenGL.
https://www.mapbox.com/mobile-maps-sdk
Other
478 stars 135 forks source link

Map flickers on certain devices #2479

Open akharche4 opened 2 months ago

akharche4 commented 2 months ago

Environment

Observed behavior and steps to reproduce

Video attached:

https://github.com/user-attachments/assets/463594b3-e37b-48a5-b21c-d1ac5c80f3a9

When mapboxGlNative is set to 11.5.2 or higher in libs.versions.toml, the map flickers as shown in the video. It flickers only on certain zoom levels as can be seen in video attached.

When mapboxGlNative is set to 11.5.1, the map behaves as expected.

Notes / preliminary analysis

this issue did not occur on physical device pixel 6, android 14 the issue also did not occur on emulator pixel 6, api 30

barnisfar commented 1 month ago

I can confirm this behaviour on: Samsung Galaxy A40 Android version: 11 OneUI version: 3.1 Mapbox sdk version: 11.5.1

flasher297 commented 1 month ago

Thank you for raising an issue. We've created an internal ticket to investigate it. Will be back as soon as we have any updates.

msuonp commented 1 month ago

I’m experiencing similar map flickering issues on certain devices (Honor X7a, Redmi 9C) when using Mapbox SDK versions 11.7.0 and 11.7.1. The map is unresponsive to gestures, although camera change callbacks are still triggered, and the cameraState reflects the updated camera position. The issue does not occur with earlier SDK versions.

https://github.com/user-attachments/assets/1a41dfb7-a26f-4504-8251-6b1cde02569d

kiryldz commented 1 month ago

@akharche4 can you confirm that you reproduce this in our example activity with no additions? Also can you share the logs? And also another question - is 11.5.1 the first version you saw this?

@msuonp can you also share the logs and also confirm that on Honor X7a, Redmi 9C you face the same issue in activity that @akharche4 reported? Trying to narrow down the root cause here...

akharche4 commented 1 month ago

@kiryldz just to sort of be clear, I experience issues ONLY for when mapboxGlNative was set to 11.5.2 or higher. So NO issues on 11.5.1 of mapboxGlNative

from above desc:

When mapboxGlNative is set to 11.5.2 or higher in libs.versions.toml, the map flickers as shown in the video. It flickers only on certain zoom levels as can be seen in video attached.

When mapboxGlNative is set to 11.5.1, the map behaves as expected.

I did not change anything in Activity.

Logs of what exactly would you like?

kiryldz commented 1 month ago

Logs with Mapbox tag of level warning and error if there are any.

Edit: in general all the logs will be appreciated as we're leaning to the theory that this issue is hardware specific so there might be GPU driver error logs in logcat as well.

msuonp commented 1 month ago

@kiryldz I tested the example activity on the Redmi 9C, and it exhibits flickering and various rendering issues, such as markers not always being drawn. Unfortunately, there are no errors or warnings in the logs related to Mapbox or the GPU.

I currently don't have access to the Honor X7a to test on that device. The issue was originally reported by an end user, and I was able to reproduce it on the Redmi 9C.

https://github.com/user-attachments/assets/13f8ea98-8c38-4db0-85ef-cd3097fc97ae

clmoreno commented 2 weeks ago

I'm experiencing same issue with v11.7.1 :(

Manahil26397 commented 2 weeks ago

I am experiencing the same flickering on my Redmi A3x Android 14 device when I upgraded to mapbox version 11.7.1

https://github.com/user-attachments/assets/7c3429d3-10a0-461e-b366-d61ec1b9d5d8

Manahil26397 commented 1 week ago

This is still present in version 11.8.0

akharche4 commented 1 week ago

@kiryldz

@akharche4 can you confirm that you reproduce this in our example activity with no additions? Also can you share the logs? And also another question - is 11.5.1 the first version you saw this?

@msuonp can you also share the logs and also confirm that on Honor X7a, Redmi 9C you face the same issue in activity that @akharche4 reported? Trying to narrow down the root cause here...

Logs: commit: 3ab81e90

---------------------------- PROCESS STARTED (23095) for package com.mapbox.maps.testapp ----------------------------
MapboxInitializer       MapboxSDKCommonInitializer create() is called
MapboxInitializer       MapboxInitializer started MapboxSDKCommonInitializerImpl initialization, attempt 1
Mapbox                  [common]: Using Mapbox Common SDK v24.5.0(edbe9cbfd)
MapboxInitializer       Initialized MapboxSDKCommonInitializerImpl successfully
MapboxInitializer       MapboxMapsInitializer create() is called
MapboxInitializer       MapboxInitializer started MapboxMapsInitializerImpl initialization, attempt 1
Mapbox                  [MapboxReachability]: Application permission for ACCESS_NETWORK_STATE granted
Mapbox                  [maps-core]: Using Mapbox Core Maps SDK v11.5.2(b21f926fdb)
MapboxInitializer       Initialized MapboxMapsInitializerImpl successfully
Mapbox                  [config_service]: Stored configuration options are expired or lacks expiration date.
Mapbox                  [config_service]: Stored configuration options are expired or lacks expiration date.
Mapbox                  [LifecycleUtils]: Task: TaskInfo{userId=0 stackId=1270 taskId=1270 displayId=0 isRunning=true baseIntent=Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.mapbox.maps.testapp/.ExampleOverviewActivity } baseActivity=ComponentInfo{com.mapbox.maps.testapp/com.mapbox.maps.testapp.ExampleOverviewActivity} topActivity=ComponentInfo{com.mapbox.maps.testapp/com.mapbox.maps.testapp.ExampleOverviewActivity} origActivity=null realActivity=ComponentInfo{com.mapbox.maps.testapp/com.mapbox.maps.testapp.ExampleOverviewActivity} numActivities=1 lastActiveTime=413411 lastGainFocusTime=412723 supportsSplitScreenMultiWindow=true resizeMode=1 isResizeable=true token=android.window.WindowContainerToken@ad89b71 topActivityType=1 pictureInPictureParams=null topActivityInfo=ActivityInfo{7fccd56 com.mapbox.maps.testapp.ExampleOverviewActivity} isPairTask=false pairedTaskIds=[] pairWindowingMode=0 pairDockSide=0 topLaunchHomeActivity=false launchSplitWindowingMode=0 splitScreenCreateMode=SPLIT_SCREEN_CREATE_MODE_TOP_OR_LEFT topDockSide=0 topSplitRatio=0.00000 launchSplitMode=0
Mapbox                  [LifecycleUtils]: Task: TaskInfo{userId=0 stackId=1270 taskId=1270 displayId=0 isRunning=true baseIntent=Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.mapbox.maps.testapp/.ExampleOverviewActivity } baseActivity=ComponentInfo{com.mapbox.maps.testapp/com.mapbox.maps.testapp.ExampleOverviewActivity} topActivity=ComponentInfo{com.mapbox.maps.testapp/com.mapbox.maps.testapp.ExampleOverviewActivity} origActivity=null realActivity=ComponentInfo{com.mapbox.maps.testapp/com.mapbox.maps.testapp.ExampleOverviewActivity} numActivities=1 lastActiveTime=414410 lastGainFocusTime=412723 supportsSplitScreenMultiWindow=true resizeMode=1 isResizeable=true token=android.window.WindowContainerToken@ad89b71 topActivityType=1 pictureInPictureParams=null topActivityInfo=ActivityInfo{6c339d8 com.mapbox.maps.testapp.ExampleOverviewActivity} isPairTask=false pairedTaskIds=[] pairWindowingMode=0 pairDockSide=0 topLaunchHomeActivity=false launchSplitWindowingMode=0 splitScreenCreateMode=SPLIT_SCREEN_CREATE_MODE_TOP_OR_LEFT topDockSide=0 topSplitRatio=0.00000 launchSplitMode=0
Mapbox                  [metrics]: Metrics collection period: 0s
Mapbox                  [config_service]: Stored configuration options are expired or lacks expiration date.
Mapbox                  [metrics]: Metrics collection period: 0s
Mapbox                  [maps-android\Mbgl-RenderThread]: renderThreadPrepared=false and Android surface is not valid (isValid=null). Waiting for new one.
Mapbox                  [maps-android\Mbgl-RenderThread]: renderThreadPrepared=false and Android surface is not valid (isValid=null). Waiting for new one.
Mapbox                  [config_service]: No configuration options found stored on the disk.
Mapbox                  [maps-android\Mbgl-RenderThread]: renderThreadPrepared=false and Android surface is not valid (isValid=null). Waiting for new one.
Mapbox                  [maps-android\Mbgl-RenderThread]: Renderer resumed, renderThreadPrepared=false, surface.isValid=null
Mapbox                  [maps-android\Mbgl-RenderThread]: renderThreadPrepared=false and Android surface is not valid (isValid=null). Waiting for new one.
Mapbox                  [maps-android\Mbgl-RenderThread]: renderThreadPrepared=false and Android surface is not valid (isValid=null). Waiting for new one.
Mapbox                  [maps-android\Mbgl-RenderThread]: onSurfaceCreated
Mapbox                  [maps-android\Mbgl-RenderThread]: onSurfaceCreated: waiting Android surface to be processed...
Mapbox                  [maps-android\Mbgl-RenderThread]: Setting up render thread, flags: creatingSurface=true, nativeRenderCreated=false, eglContextMadeCurrent=false, eglContextCreated=false, paused=false
Mapbox                  [maps-android\Mbgl-EGLConfigChooser]: In emulator: false
Mapbox                  [maps-android\Mbgl-EglCore]: EGLContext created, client version 3
Mapbox                  [maps-core]: Using OpenGL render backend
Mapbox                  [maps-android\Mbgl-RenderThread]: Native renderer created.
Mapbox                  [maps-android\Mbgl-RenderThread]: onSurfaceCreated: Android surface was processed.
Mapbox                  [tile_store]: Searching for stray files to clean up
Mapbox                  [tile_store]: Cleanup of stray partial downloads complete
Mapbox                  [tile_store]: Searching for stale partial downloads to clean up
Mapbox                  [tile_store]: Cleanup of stray partial downloads complete
Mapbox                  [maps-core]: {}[Render]: The layer 'natural-point-labelbasemap' uses more data-driven properties than some devices may support. Though it will render correctly on this device, it may have rendering errors on other devices. To ensure compatibility with all devices, use 1 fewer data-driven properties in this layer.
Mapbox                  [maps-core]: {}[Render]: The layer 'road-number-shieldbasemap' uses more data-driven properties than some devices may support. Though it will render correctly on this device, it may have rendering errors on other devices. To ensure compatibility with all devices, use 1 fewer data-driven properties in this layer.
Mapbox                  [maps-core]: {}[Render]: The layer 'poi-labelbasemap' uses more data-driven properties than some devices may support. Though it will render correctly on this device, it may have rendering errors on other devices. To ensure compatibility with all devices, use 1 fewer data-driven properties in this layer.
Mapbox                  [maps-core]: {}[Render]: The layer 'water-line-labelbasemap' uses more data-driven properties than some devices may support. Though it will render correctly on this device, it may have rendering errors on other devices. To ensure compatibility with all devices, use 1 fewer data-driven properties in this layer.
Mapbox                  [maps-core]: {}[Render]: The layer 'water-point-labelbasemap' uses more data-driven properties than some devices may support. Though it will render correctly on this device, it may have rendering errors on other devices. To ensure compatibility with all devices, use 1 fewer data-driven properties in this layer.
kiryldz commented 6 days ago

The issue should be fixed in 11.8.1 and backported to 11.7.3. Both patches are expected this week.

flasher297 commented 4 days ago

11.7.3 patch release with a fix for this problem has been published. You can give it a try. https://github.com/mapbox/mapbox-maps-android/releases/tag/v11.7.3