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
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Custom icon potentially causing crash on certain devices #3031
While testing the Mapbox Android SDK custom marker example, I ran into some errors running a simple version on a Nexus 5x. Here are the steps I took:
Open the app as-is in AVD (both API 21 and 23): App installs and opens without error. Custom marker is present.
Open the app as-is on my Nexus 5x via ADB: app installs and opens, but force closes right away. Nothing is printed to logcat in Android Studio.
Open the app on my Nexus 5x with mimpap instead of drawable in R.drawable.ic_directions_boat_black_18dp (and created corresponding image files in the proper mipmap_ directories): same result as above.
Open the app on my Nexus 5x without .icon(icon): app installs and opens without error.
@danswick Hey Dan, thanks for the feedback. I just created a new project with the custom marker sample code but I couldn't reproduce your issue.
I'd love to see if we could get some crash logs to investigate further. Could you re-rerun your sample code making sure this dropdown in Android Studio is set as "no-filters"?
@vfaSonnt thanks for the feedback. It doesn't seem like you were using the assets in the sample page, may I ask which assets resolutions are you using in your sample code?
In my tests:
It crashes with the signal 6 (SIGABRT) error on Samsung Galaxy S6 running 5.1.1.
On the Nexus 5 running 6.0 same thing.
On the GT-I9I90 running 4.4.2, the maps will display the markers, but every marker will use the first resource I loaded (any attempt at using another picture for a marker will ignore the new resource I gave it).
I'm seeing the same issue on 2.2.0
As best as I can tell it's a issue with truncating the width and height to an int.
MapView.java loadSprite() line 1664 does width / scale and truncates to int
SpriteImage.cpp line 17 then does width * scale
with a 590x290 image on a device with scale of 3.5 3 pixels are lost in the height causing an exception on line 25.
If we can settle on this we can then move forward with a either a fix to ensure that width and height are always the same size and/or build out support for different sizes.
Discussed with @1ec5@friedbunny@jfirebaugh and this appears to be an issue with the common Core GL as it's impacting iOS too. Work is being done at that level to address an issue with integer / float conversions.
Activity
zugaldia commentedon Nov 16, 2015
@danswick Hey Dan, thanks for the feedback. I just created a new project with the custom marker sample code but I couldn't reproduce your issue.
I'd love to see if we could get some crash logs to investigate further. Could you re-rerun your sample code making sure this dropdown in Android Studio is set as "no-filters"?
danswick commentedon Nov 18, 2015
Thanks, @zugaldia. Remembered my USB-C cable today and here's the unfiltered log:
For good measure, I just tested on my 2013 Moto X running 5.1 and didn't get any errors.
vfaSonnt commentedon Nov 19, 2015
I got the same issue on Nexus7 OS 5.0.2. with
mapbox-android-sdk:2.2.0@aarThis is source code I used to make marker.
zugaldia commentedon Nov 19, 2015
@vfaSonnt thanks for the feedback. It doesn't seem like you were using the assets in the sample page, may I ask which assets resolutions are you using in your sample code?
vfaSonnt commentedon Nov 20, 2015
@zugaldia thank for the reply. I think I found the problem.
It crash in this method .
But it can run on android os JELLY_BEAN
This is bitmap info.

afathman commentedon Nov 20, 2015
In my tests:
It crashes with the signal 6 (SIGABRT) error on Samsung Galaxy S6 running 5.1.1.
On the Nexus 5 running 6.0 same thing.
On the GT-I9I90 running 4.4.2, the maps will display the markers, but every marker will use the first resource I loaded (any attempt at using another picture for a marker will ignore the new resource I gave it).
MrChaz commentedon Nov 23, 2015
I'm seeing the same issue on 2.2.0
As best as I can tell it's a issue with truncating the width and height to an int.
MapView.java loadSprite() line 1664 does width / scale and truncates to int
SpriteImage.cpp line 17 then does width * scale
with a 590x290 image on a device with scale of 3.5 3 pixels are lost in the height causing an exception on line 25.
tobrun commentedon Nov 24, 2015
I have noticed this issue also, I created #3108, will close that one down in favor of this one:
Referencing symbolicated stacktrace from that issue:
@zugaldia: here are the details to reproduce this issue:
LMK if you need extra 👀 on this
bleege commentedon Nov 30, 2015
Thanks for reporting this @vfaSonnt!
@afathman @MrChaz can you confirm this too with your apps?
If we can settle on this we can then move forward with a either a fix to ensure that width and height are always the same size and/or build out support for different sizes.
bleege commentedon Nov 30, 2015
Discussed with @1ec5 @friedbunny @jfirebaugh and this appears to be an issue with the common Core GL as it's impacting iOS too. Work is being done at that level to address an issue with integer / float conversions.
afathman commentedon Dec 1, 2015
Yea, it crashes whether or not the dimensions are the same or different. Can confirm the issue is with the integer/float conversion.
dino368 commentedon Dec 2, 2015
I had the same issue! I found out that the image has to be 72x72! Try it out and replay.
EDIT: I think you can use all parts of 72. 216x216 also works.
20 remaining items
[android] #3031 - test branch android
tobrun commentedon Jan 14, 2016
@ansis
Yes, validated that it's generating the same crashlog:
I just pushed my branch if you want to test your changes or ping me if I need to perform a test.
jfirebaugh commentedon Jan 14, 2016
That crashlog suggests that one of these validations is failing. That would indicate that this is a problem in the bindings:
ansis commentedon Jan 20, 2016
this is fixed by #3561