Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: ViewAnnotationManager.swift throws error when running or building on iOS ^18 and expo ^51 #3688

Open
doguyilmaz opened this issue Nov 11, 2024 · 4 comments · May be fixed by #3696
Open
Labels
bug 🪲 Something isn't working

Comments

@doguyilmaz
Copy link

Mapbox Implementation

Mapbox

Mapbox Version

11.4.0

React Native Version

0.74.5

Platform

iOS

@rnmapbox/maps version

10.1.33

Standalone component to reproduce

  • iOS version 18.1 and Xcode 16.1
  • Install the related/latest versions
  • Run/build app then it throws error
import React from 'react';
import {
  MapView,
  ShapeSource,
  LineLayer,
  Camera,
} from '@rnmapbox/maps';

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

class BugReportExample extends React.Component {
  render() {
    return (
      <MapView style={{flex: 1}}>
        <Camera centerCoordinate={[-74.00597, 40.71427]} zoomLevel={14} />
        <ShapeSource id="idStreetLayer" shape={aLine}>
          <LineLayer id="idStreetLayer" />
        </ShapeSource>
      </MapView>
    );
  }
}

Observed behavior and steps to reproduce

❌  (ios/Pods/MapboxMaps/Sources/MapboxMaps/Annotations/ViewAnnotationManager.swift:84:19)

  82 |     @available(*, deprecated, renamed: "allAnnotations", message: "Please use allAnnotations instead, or directly access ViewAnnotation itself")
  83 |     public var annotations: [UIView: ViewAnnotationOptions] {
> 84 |         idsByView.compactMapValues { [mapboxMap] id in
     |                   ^ cannot convert return expression of type '[UIView : ViewAnnotationOptions]' to return type 'Dictionary<String, Optional<JSONValue>>.RawValue' 
  85 |             try? mapboxMap.options(forViewAnnotationWithId: id)
  86 |         }
  87 |     }

Expected behavior

Not to throw error due to ViewAnnotationManager.swift:84:19

Notes / preliminary analysis

No response

Additional links and references

This issue mentioned in #3640 but tagged as addressed and closed but still continues.

@doguyilmaz doguyilmaz added the bug 🪲 Something isn't working label Nov 11, 2024
@Rashotech
Copy link

Facing same issue

@ABertaud
Copy link

same here

@mpiannucci
Copy link

mpiannucci commented Nov 13, 2024

This was fixed for me by changing the mapbox maps version to 11.8 from 11.4

@jamesbtlr
Copy link

Same issue here. React Native 0.73.6, everything else the same as in the issue.

@RyanTG RyanTG linked a pull request Nov 15, 2024 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants