mapbox / mapbox/mapbox-maps-android

Warning spam in log when animating point annotations after style change (memory leak)

Open
#2,207 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triaged bug :beetle: v11
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.