Post

Replies

Boosts

Views

Activity

"Multiple Commands Produce Info.plist" error in Xcode 15
I keep on getting the same error when trying to build my project. It seems to stem from a problem that I am having entering the path to the info.plist file in packaging/build settings. I have repeatedly tried to install the proper path as "$(SRCROOT)/Main Project Group/Info.plist", yet as soon as I hit return, the path reverts to "/Users/josephnicholas/Documents/dEATour/Xcode/dEATourSunday/Main Project Group/Info.plist" and I get the following error when I clean/build the project: "/Users/josephnicholas/Documents/dEATour/Xcode/dEATourSunday/dEATourSunday.xcodeproj One of the paths in DEVELOPMENT_ASSET_PATHS does not exist: /Users/josephnicholas/Documents/dEATour/Xcode/dEATourSunday/dEATourSunday/Preview Content". I have deleted the info.plist file and reinstalled it, I have even started a new project this morning, transferring all of my files. I cannot figure out how to prevent the path in 'packaging' from reverting back to the absolute path and throwing this error out. I'd really appreciate any help anyone can offer. Thanks.
3
0
168
1w
Mapkit SwiftUI iOS17
I am trying to load and view several locations onto a map from a JSOPN file in my SwiftUI project, but I continually encounter the error "no exact matches in call to initializer" in my ContentView.swift file. What I Am Trying to Do: I am working on a SwiftUI project where I need to display several locations on a map. These locations are stored in a JSON file, which I have successfully loaded into Swift. My goal is to display these locations as annotations on a Map view. JSON File Contents: coordinates: latitude and longitude name: name of the location uuid: unique identifier for each location Code and Screenshots: Here are the relevant parts of my code and the error I keep encountering: import SwiftUI import MapKit struct ContentView: View { @State private var mapPosition = MapCameraPosition.region( MKCoordinateRegion( center: CLLocationCoordinate2D(latitude: 37.7749, longitude: -122.4194), span: MKCoordinateSpan(latitudeDelta: 0.05, longitudeDelta: 0.05) ) ) @State private var features: [Feature] = [] var body: some View { NavigationView { Map(position: $mapPosition, interactionModes: .all, showsUserLocation: true) { ForEach(features) { feature in Marker(coordinate: feature.coordinate) { FeatureAnnotation(feature: feature) } } } .onAppear { POILoader.loadPOIs { result in switch result { case .success(let features): self.features = features case .failure(let error): print("Error loading POIs: \(error.localizedDescription)") } } } .navigationBarTitle("POI Map", displayMode: .inline) } } } struct FeatureAnnotation: View { let feature: Feature var body: some View { VStack { Circle() .strokeBorder(Color.red, lineWidth: 2) .background(Circle().foregroundColor(.red)) .frame(width: 20, height: 20) Text(feature.name) } } } I have not had any luck searching for solutions to my problems using the error messages that keep arising. Does anyone have any advice for how to move forward?
2
0
192
1w
SwiftUI iOS 17, Xcode 15.3 MapContentBuilder
I consistently get an error that the Map initailizer I'm using is deprecated and I should use a MapContent builder instead. Various errors such as "'MapAnnotation' was deprecated in iOS 17.0: Use Annotation along with Map initializers that take a MapContentBuilder instead." or "'init(coordinateRegion:interactionModes:showsUserLocation:userTrackingMode:annotationItems:annotationContent:)' was deprecated in iOS 17.0: Use Map initializers that take a MapContentBuilder instead." The problem in my code seems to be located here: import SwiftUI import MapKit struct ContentView: View { @State private var region = MKCoordinateRegion( center: CLLocationCoordinate2D(latitude: 34.0522, longitude: -118.2437), span: MKCoordinateSpan(latitudeDelta: 0.5, longitudeDelta: 0.5) ) @State private var restaurants: [Restaurant] = [] var body: some View { Map(coordinateRegion: $region, annotationItems: restaurants) { restaurant in // This uses the updated Annotation API MapAnnotation(coordinate: restaurant.coordinate) { VStack { Text(restaurant.restaurantName) .bold() .foregroundColor(.white) .padding(5) .background(Color.black.opacity(0.75)) .cornerRadius(10) .fixedSize() Image(systemName: "mappin.circle.fill") .foregroundColor(.red) .font(.title) } } The errors persistently occur in the lines immediately below var body: some View { I've been stuck on this for two days now. Any help would be greatly appreciated.
1
1
192
3w