mapbox-gl-native
mapbox-gl-native copied to clipboard
Black annotations/images on certain zoom levels
When running the test app on an emulator (8.1.0 or 4.4) I'm running into issues with gl rendered images, markers and labels.

I wasn't able to reproduce this on a physical device running 6.0.1.
Also, looks like it's only in SDK versions 5.2.0 and upwards, I wasn't able to reproduce the issue on an emulator running 5.1.5.
This happened on android devices on 8.1, 6.0.1, 7.0, mapbox 5.1.4
I'm also seeing this with mapbox 5.3.1 on Android Version 8.x and 7.x
I'm also seeing this on Android 8.x, 7.x with mapbox 5.3.1
Thanks for your input @dylan-chong, @JustSayBien and @tStaiger. Were you using emulators or physical devices? If the latter, could you let us know which phone models did you use for testing?
Hi @LukasPaczos,
i tested on emulators and was not able to reproduce this issue on a physical device.
One of the devices was a nexus 6P.
I remember you must add lots of markers to the map for the bug to happen,, but it seems to be not happen to me on android 5.2.1, just 5.1.4
Another device was a Galaxy S6.
Happens to me also on emulators. Also, since I updated the SDK to 5.3.1 from 5.2.0 (needed that for the attribution button exposed classes), the annotations flicker once on physical devices. I'm using ObjectAnimator's ability to modify the position attribute and move a Marker along with the camera
@andrei-cimpan your issue should be fixed with https://github.com/mapbox/mapbox-gl-native/pull/10899 that will be included in our 6.0.0 release. In the mean time, could you re-test this with 6.0.0-SNAPSHOT? If you will still be able to reproduce the flickering, please create a new issue. Thanks!
Hello, is this bug still under investigation ? We are experiencing the same bug in 6.3.0 version. We opened a new issue ( https://github.com/mapbox/mapbox-gl-native/issues/12671 ) but it was linked to this one and closed. For us this is a blocking issue for integrating this version. Thanks !
@philemonmerlet I have this issue only while using ProGuard. I've added -keep for mapbox and works fine now. using version 6.4.0
Thanks for your feedback, unfortunately in our case we were not using proguard.
+1 Same here, using Mapbox SDK 6.2.1
Capturing from an user that the following configuration is working well for them:
OpenGL ES renderer: SwiftShader
OpenGL ES API level: Render maximum (up to OpenGL ES 3.1)
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.
Confirmed that configuring SwiftShader fixes the black assets on the map. However it drastically decreases performance of the emulator (tested on macOS) I hope this can be fixed for the native renderer some day 🥇
Capturing from an user that the following configuration is working well for them:
OpenGL ES renderer: SwiftShader OpenGL ES API level: Render maximum (up to OpenGL ES 3.1)
This worked for me. Thank you!
In Android Manifest I added:
<uses-feature android:glEsVersion="0x00030001" android:required="true" />
And in config.ini of my emulator I added:
hw.gpu.enabled=yes
hw.gpu.mode=swiftshader_indirect
(Using a MacBook Pro 15 from 2018)
I tried adding
But it didn't work.
I saw the advice above about adding properties to config.ini but I don't know where to find the config.ini file and I couldn't easily find relevant documentation about it.
I found that simply modifying a marker can make it gray in an emulator. And I have prepared a simple program to reproduce this issue: https://github.com/ystsoi/mapbox-gl-native/tree/test-emulator-marker-issue/TestEmulatorMarkerIssue
Tapping the "Show/Update Marker" button once will show a marker. Tapping the button again will change its size, which will make it gray in an emulator.
After tracing, I noticed that when creating a texture for an icon atlas image (https://github.com/ystsoi/mapbox-gl-native/blob/ae4a0c3ee3c9aadabb49f607425920ce38a53ec9/src/mbgl/tile/geometry_tile.cpp#L97), an old texture id for a glyph atlas image (https://github.com/ystsoi/mapbox-gl-native/blob/ae4a0c3ee3c9aadabb49f607425920ce38a53ec9/src/mbgl/tile/geometry_tile.cpp#L92) may be reused. I also noticed that the formats of the images are different.
I suspected that this may cause the issue, so I tried to disable the texture pool (https://github.com/ystsoi/mapbox-gl-native/commit/abf9cceaa5232adfb571210445c7a50570d9c5fd). This solves the marker issue in emulators! As the texture pool is disabled, I also tried to prevent creating some textures unnecessarily (https://github.com/ystsoi/mapbox-gl-native/commit/f4cdc901aa3debfb7c418c0fd16e8fe28efa8b3f).
In fact, I am not familiar with OpenGL, see whether this finding helps to solve the issue, or whether this helps to confirm a bug in the emulator.
Although we believe this issue can be caused by a variety of factors and configurations unrelated to Mapbox software, we've had customers report positive outcomes when switching their emulator settings to use software rendering. This comes at a performance cost, but should avoid some GPU/driver problems in specific development environments. At the risk of stating the obvious: we don't believe this issue occurs anywhere but the emulator.
thanks @silviokuehn this worked for me on Linux Mint 20.2 :
In Android Manifest:
<uses-feature android:glEsVersion="0x00030001" android:required="true" />
And in config.ini of emulator:
hw.gpu.enabled=yes
hw.gpu.mode=swiftshader_indirect
@LocusLabsGit the config.ini is related to avd, on linux it can be found at ~/.android/avd/emulator.avd/config.ini where emulator is the name of the emulator device in my case it's ~/.android/avd/Nexus_5_API_30.avd/config.ini