11

I'm using GoogleMaps Pod in my project. I have error in one of my Storyboard:

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

I have set view class to GMSMapView:

enter image description here

App is working on simulator. How I can fix this error? It causes whole storyboard to be blank.

Prettygeek
  • 2,461
  • 3
  • 22
  • 44
  • 3
    storyboard: error: IB Designables: Failed to render and update auto layout status for NearByPlaceListingViewController (yxD-BC-CKt): dlopen(GoogleMaps.framework, 1): no suitable image found. Did find: GoogleMaps.framework: mach-o, but wrong filetype I am getting Same Error... in Xcode 9.2 – Shahabuddin Vansiwala Mar 08 '18 at 13:15
  • Please suggest if you have fixed. – Shahabuddin Vansiwala Mar 08 '18 at 13:31
  • 1
    I’m creating this map view form code right now, I couldn’t make it work from storyboard. @ShahabuddinVansiwala – Prettygeek Apr 11 '18 at 15:29

2 Answers2

5

Create Subclass of GMSMapView and use that class name instead of GMSMapView. after adding this error will not occur and whole storyboard is working.

import GoogleMaps

class GoogleMapView : GMSMapView {

}
Som Nai
  • 91
  • 1
  • 6
  • 1
    Didn't solve the problem in my case. I even changed GMSMapView to simple UIView and I still have storyboard issues, despite cleaning, deleting derived data and restarting Xcode. – Makalele May 31 '19 at 12:41
2

Use GMSMapView manually by writing code in simulator; Instead of using GMSMapView in storyboard.

If you are using maps in multiple screen. then write code manually for all file.

@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)

}
Sourabh Sharma
  • 8,222
  • 5
  • 68
  • 78