I’m building an iOS application that uses GoogleMaps iOS SDK. I added the SDK with Swift Package Manager, and it worked; however, the previews are not working anymore because Google Maps SDK is a static library, and XCode cannot show previews with static libraries.
So I tried creating a dynamic framework separately, and while at it, I thought moving all navigation-related logic to that framework would be nice. I was able to build the framework, and the application builds fine, but it doesn’t run in the simulator. The error I get is:
The request was denied by service delegate (SBMainWorkspace).
...
Launchd job spawn failed
Domain: NSPOSIXErrorDomain
Code: 8
Failure Reason: Exec format error
I checked the build settings and the architecture is arm64 in both targets (framework and the app).
Any ideas or tips on how to debug the issue?
The code in the framework is:
import SwiftUI
import GoogleMaps
public class GoogleMapViewController: UIViewController {
override public func viewDidLoad() {
super.viewDidLoad()
let options = GMSMapViewOptions()
options.camera = GMSCameraPosition.camera(withLatitude: -33.86, longitude: 151.20, zoom: 6.0)
options.frame = self.view.bounds
let mapView = GMSMapView(options: options)
self.view.addSubview(mapView)
}
}
public struct GoogleMapViewControllerRepresentable: UIViewControllerRepresentable {
public init() {}
public func makeUIViewController(context: Context) -> GoogleMapViewController {
return GoogleMapViewController()
}
public func updateUIViewController(_ uiViewController: GoogleMapViewController, context: Context) {
}
}