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

[Android] Crash on API 20 and below on LocationComponent #15026

Closed
chloekraw opened this issue Jun 28, 2019 · 0 comments · Fixed by #15099
Closed

[Android] Crash on API 20 and below on LocationComponent #15026

chloekraw opened this issue Jun 28, 2019 · 0 comments · Fixed by #15099
Assignees
Labels
Android Mapbox Maps SDK for Android crash

Comments

@chloekraw
Copy link
Contributor

User has reported the following info. Sounds similar to #14889.

Description

There is an IllegalArgumentException being thrown from LocationLayerController.java:styleShadow(). This only happens on API 20 and below because API 21 fixed the root cause of this issue , while API 20 and below will pass an invalid radius to RadialGradient without this if check.

This is causing a crash for some users on older devices, particularly in some sort of windowed state where the radius could default to having a 0 or negative radius given the xml defines the radius in dp.

To fix this, perhaps the styleShadow method should be wrapped in a try catch. I'm not sure if there's another way to fix this so the shadow is always present even for users in API 20 and below, since a try-catch may prevent future draws if the style.addImage call is never fired to actually add the bitmap for the shadow to the map.

Steps to reproduce

Unable to reproduce.

Expected behavior

A shadow appears on the LocationComponent for older devices

Actual behavior

IllegalArgumentException is thrown in Android drawable infra code, typically causing a total app crash.

Configuration

Android API 20 and below will be affected, not sure if any specific architectures are susceptible to this bug but it seems to be related to some sort of windowed capability.

This mostly occurs on Android 4.4.4 with a peak in Lenovo P70-A devices.

cc: @LukasPaczos

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android crash
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants