You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's very hard to reproduce, but once in a while I get an error like the following on Android:
ERROR Mapbox error Exception failed during setIconImage: Set layer property "icon-image" failed:
Layer nav-icon is not in style
[get, arrow] {"level": "error", "message": "Exception failed during setIconImage: Set layer property \"icon-image\" failed:
It's not exclusively icon-image - If I comment out that property, the error falls back to the next one, in this case icon-offset.
I'm not able to deliberately reproduce the error. (In particular, I tried changing the layer ID just before setProperty() is called, but the effect is that it simply doesn't display the layer - no exception throws.)
Notes / preliminary analysis
I've been down in the Android SDK code for a while. The error is clearly surfacing here, but the actual function call is happening in the generated file here.
I don't follow why a layer would occasionally fail to get added to style, but it sure seems like a race condition.
Any ideas about how to track this one down? Alternatively, I'm wondering if you'd be open to a PR that wraps this line in a try/catch, or potentially regenerates RCTMGLStyleFactory with try blocks around all the setters - the interim goal being to throw a warning instead of an error.
The text was updated successfully, but these errors were encountered:
@naftalibeder thanks much for the report. Do you have before/after ID on that particular layer?! Also do you have change the style of the map, that removes then readds all the layers.
Is this an existing layer on the style or is it handled by rnmapbox?
I'd debug such issue with adding a breakpoint in the native layer, and also logging where layer get's added/removed. And if we call setPropery before adding the layer or after removing it.
Making this into a warning is acceptable but not great, but it would be much more valueble to do some investigation and try to find out what's going on.
Mapbox Implementation
Mapbox
Mapbox Version
default
Platform
Android
@rnmapbox/maps
version#main
Component to reproduce
This isn't standalone, but here is the basic structure.
Observed behavior and steps to reproduce
It's very hard to reproduce, but once in a while I get an error like the following on Android:
It's not exclusively
icon-image
- If I comment out that property, the error falls back to the next one, in this caseicon-offset
.I'm not able to deliberately reproduce the error. (In particular, I tried changing the layer ID just before
setProperty()
is called, but the effect is that it simply doesn't display the layer - no exception throws.)Notes / preliminary analysis
I've been down in the Android SDK code for a while. The error is clearly surfacing here, but the actual function call is happening in the generated file here.
I don't follow why a layer would occasionally fail to get added to style, but it sure seems like a race condition.
Any ideas about how to track this one down? Alternatively, I'm wondering if you'd be open to a PR that wraps this line in a try/catch, or potentially regenerates
RCTMGLStyleFactory
with try blocks around all the setters - the interim goal being to throw a warning instead of an error.The text was updated successfully, but these errors were encountered: