You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
not convert return expression of type '[UIView : ViewAnnotationOptions]' to return type 'Dictionary<String, Optional<JSONValue>>.RawValue' (aka 'Dictionary<String, Optional<Any>>')
#3738
Open
matiastang opened this issue
Jan 13, 2025
· 1 comment
If the build in Xcode or Expo fails and shows the following error: Cannot convert return expression of type '[UIView : ViewAnnotationOptions]' to return type 'Dictionary<String, Optional>.RawValue' (aka 'Dictionary<String, Optional>')
The error originates from lines 76-82 in the Pods->MapboxMaps->ViewAnnotationManager file.
/// The complete list of annotations associated with the receiver.
@available(*, deprecated, message:"Use ViewAnnotation")publicvarannotations:[UIView:ViewAnnotationOptions]{
idsByView.compactMapValues{[mapboxMap] id intry? mapboxMap.options(forViewAnnotationWithId: id)}}
It’s just a type error, and I bypassed this error using the following method.
/// The complete list of annotations associated with the receiver.
@available(*, deprecated, message:"Use ViewAnnotation")publicvarannotations:[UIView:ViewAnnotationOptions]{return[:]}
The annotations property has been deprecated, which might be an issue with the mapbox-gl version.
The text was updated successfully, but these errors were encountered:
/// The complete list of annotations associated with the receiver.
@available(*, deprecated, message: "Use ViewAnnotation")
public var annotations: [UIView: ViewAnnotationOptions] {
let values = idsByView.compactMapValues { [mapboxMap] id in
try? mapboxMap.options(forViewAnnotationWithId: id)
}
return values
}
Environment
Steps to reproduce
If the build in Xcode or Expo fails and shows the following error: Cannot convert return expression of type '[UIView : ViewAnnotationOptions]' to return type 'Dictionary<String, Optional>.RawValue' (aka 'Dictionary<String, Optional>')
The error originates from lines
76-82
in thePods
->MapboxMaps
->ViewAnnotationManager
file.It’s just a type error, and I bypassed this error using the following method.
The annotations property has been deprecated, which might be an issue with the
mapbox-gl
version.The text was updated successfully, but these errors were encountered: