mapbox / mapbox/mapbox-maps-android
Warning spam in log when animating point annotations after style change (memory leak)
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 578
- Forks
- 161
- PR merge metrics
- No merged PRs in 30d
Description
## Environment
- Android OS version: 10
- Devices affected: DJI RC Pro
- Maps SDK Version: 11.0.0-beta.5
## Observed behavior and steps to reproduce
I am animating point annotations (using PointAnnotationManager), but after I load a new style the log gets spammed with
```
13:01:10.665 14950-15184 chatty I uid=10079 GEOJSON_PARSER identical 11 lines
13:01:10.668 14950-15184 Mapbox W [maps-android\Mbgl-Style]: Style object (accessing setStyleGeoJSONSourceData) should not be stored and used after MapView is destroyed or new style has been loaded.
13:01:10.672 14950-15184 Mapbox W [maps-android\Mbgl-Style]: Style object (accessing setStyleGeoJSONSourceData) should not be stored and used after MapView is destroyed or new style has been loaded.
```
## Expected behavior
No log spam.
## Notes / preliminary analysis
The animations are constantly moving the annotations on the map. I use Android's ValueAnimator which calls
```
annotation.point = valueAnimator.animatedValue as Point
annotationManager.update(annotation)
```
I am not calling setStyleGeoJSONSourceData anywhere by myself.
As soon as I stop the animations, the log spam stops.
If I never load a new style, there is no log spam.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with PointAnnotationManager and Android ValueAnimator: animate annotations, load a new style, and observe calls related to setStyleGeoJSONSourceData. Start by tracing annotationManager.update(annotation) during the style transition; done means the animation can continue after a style reload without repeated warnings or log spam.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100