Skip to content

[Bug]: Crash on iOS: swift_isUniquelyReferenced_nonNull_native when using ChangeLineOffsetsShapeAnimator and MovePointShapeAnimator #4003

@krisnaItsAVirus

Description

@krisnaItsAVirus

Mapbox Implementation

Mapbox

Mapbox Version

11.12.5

React Native Version

0.74.7

Platform

iOS

@rnmapbox/maps version

10.1.38

Standalone component to reproduce

// ⚠️ NOT directly reproducible, example only.
// Crash happens in production when using experimental animators.

import React from 'react';
import Mapbox, {
  MapView,
  ShapeSource,
  LineLayer,
  Camera,
  __experimental
} from '@rnmapbox/maps';

const line = {
  type: 'LineString',
  coordinates: [
    [-74.00597, 40.71427],
    [-74.00697, 40.71527],
  ],
};

export default function BugReportExample() {
  // Example of using animators involved in crashes:
  const moveAnimator = new __experimental.MovePointShapeAnimator([-74.00597, 40.71427]);
  const offsetAnimator = new __experimental.ChangeLineOffsetsShapeAnimator({
    coordinates: line.coordinates,
    startOffset: 0,
    endOffset: 0,
  });

  // In production, we call moveTo()/setEndOffset() repeatedly during animation

  return (
    <MapView style={{flex: 1}}>
      <Camera centerCoordinate={[-74.00597, 40.71427]} zoomLevel={14} />
      <ShapeSource id="line-source" shape={offsetAnimator}>
        <LineLayer id="line-layer" />
      </ShapeSource>
      <ShapeSource id="point-source" shape={moveAnimator} />
    </MapView>
  );
}

Observed behavior and steps to reproduce

We’re seeing a production crash on iOS when frequently updating a ShapeSource via:

• __experimental.MovePointShapeAnimator.moveTo
• __experimental.ChangeLineOffsetsShapeAnimator.setEndOffset

The crash is not currently reproducible in local/dev environments.
It has only occurred on one production device so far, but the stack trace is consistent and always points inside Mapbox native code during updateGeoJSONSource.

Crash Stack Trace (same as screenshot):

Image

Expected behavior

No response

Notes / preliminary analysis

No response

Additional links and references

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Author FeedbackNeeds: ReproThis issue could be improved with a clear list of steps to reproduce the issue.bug 🪲Something isn't workingiOSiOS related tickets

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions