One of the issues is caused by the friendManager parameter being private
@StateObject var friendManager: FriendManager
And for the other, maybe you have forgotten to import MapKit?
import MapKit
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: