IB Designables:无法呈现和更新 Google 地图的自动布局状态

IB Designables: Failed to render and update auto layout status for Google Maps

我在我的项目中使用 GoogleMaps Pod。我的故事板之一有错误:

error: IB Designables: Failed to render and update auto layout status for MapViewController: dlopen(GoogleMaps.framework, 1): no suitable image found. Did find: GoogleMaps.framework: mach-o, but wrong filetype

我已将视图 class 设置为 GMSMapView:

应用正在模拟器上运行。我该如何解决这个错误?它会导致整个故事板为空白。

创建 GMSMapView 的子class 并使用 class 名称代替 GMSMapView。添加后不会出现此错误,整个情节提要都可以正常工作。

import GoogleMaps

class GoogleMapView : GMSMapView {

}

通过在模拟器中编写代码手动使用GMSMapView;而不是在故事板中使用 GMSMapView

如果您在多个屏幕中使用地图。然后为所有文件手动编写代码。

@IBOutlet weak var map_Views: UIView!
var map_View = GMSMapView()
override func viewDidLoad() {

    super.viewDidLoad()

    let camera = GMSCameraPosition.camera(withLatitude: Double(main_latitude)!, longitude: Double(main_longitude)!, zoom: 6.0)
     map_View = GMSMapView.map(withFrame: CGRect.zero, camera: camera)
    map_Views = map_View

    map_View.camera = GMSCameraPosition.camera(withLatitude:Double(main_latitude)!,
                                                    longitude:Double(main_longitude)!,
                                                    zoom:10.0,
                                                    bearing: 0,
                                                    viewingAngle: 0)

}