[Bug]: Crash on iOS: swift_isUniquelyReferenced_nonNull_native when using ChangeLineOffsetsShapeAnimator and MovePointShapeAnimator
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 2.9k
- Forks
- 947
- Avg merge
- 6d 37m
- Merged PRs (30d)
- 1
Description
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):
Expected behavior
No response
Notes / preliminary analysis
No response
Additional links and references
No response
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
Start by tracing MovePointShapeAnimator.moveTo and ChangeLineOffsetsShapeAnimator.setEndOffset through the iOS update path that reaches updateGeoJSONSource, using the provided crash stack trace and reproduction example. Repeated updates should no longer produce the swift_isUniquelyReferenced_nonNull_native crash on iOS, with the behavior verified under animation-like update frequency.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, javascript, react-native
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100