Skip to content

[Bug]: Error when running on iOS #3876

@sluther

Description

@sluther

Mapbox Implementation

Mapbox

Mapbox Version

11

React Native Version

0.79.3

Platform

iOS

@rnmapbox/maps version

10.1.39

Standalone component to reproduce

import React from 'react';
import { StyleSheet } from 'react-native';

import EditScreenInfo from '@/components/EditScreenInfo';
import { Text, View } from '@/components/Themed';

import Mapbox from "@rnmapbox/maps";

Mapbox.setAccessToken("key here");

const App = () => {
  return (
    <View style={styles.page}>
      <View style={styles.container}>
        <Mapbox.MapView style={styles.map} />
      </View>
    </View>
  );
}

export default App;

const styles = StyleSheet.create({
  page: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
  },
  container: {
    height: 300,
    width: 300,
  },
  map: {
    flex: 1
  }
});

Observed behavior and steps to reproduce

After running the following commands:
npx expo install @rnmapbox/maps
npx expo install expo-dev-client
npx expo prebuild --clean
npx expo run:ios

I get the following error:

❌ (ios/Pods/MapboxMaps/Sources/MapboxMaps/Annotations/ViewAnnotationManager.swift:79:19)
77 | @available(*, deprecated, message: "Use ViewAnnotation")
78 | public var annotations: [UIView: ViewAnnotationOptions] {
79 | idsByView.compactMapValues { [mapboxMap] id in
| ^ cannot convert return expression of type '[UIView : ViewAnnotationOptions]' to return type 'Dictionary<String, Optional>.RawValue'
80 | try? mapboxMap.options(forViewAnnotationWithId: id)
81 | }
82 | }

Expected behavior

I expect the app to build and run without any errors.

Notes / preliminary analysis

No response

Additional links and references

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🪲Something isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions