I am trying to use the Google Places API autocomplete feature in my code.
import UIKit
import GoogleMaps
class ViewController: UIViewController, GMSMapViewDelegate {
var placesClient: GMSPlacesClient?
override func viewDidLoad() {
super.viewDidLoad()
placesClient = GMSPlacesClient()
let filter = GMSAutocompleteFilter()
filter.type = GMSPlacesAutocompleteTypeFilter.City
placesClient?.autocompleteQuery("Pizza", bounds: nil, filter: filter, callback: { (results, error: NSError?) -> Void in
if let error = error {
print("Autocomplete error \(error)")
}
for result in results! {
if let result = result as? GMSAutocompletePrediction {
print("Result \(result.attributedFullText) with placeID \(result.placeID)")
}
}
})
}
}
When I run it I am getting this error: CoreData: Failed to load optimized model at path '/var/mobile/Containers/Bundle/Application/
Any ideas?
Add -ObjC to "Other Linker Flags
"
(Build Settings -> Linking -> Other Linker Flags).
This solved it for me.
After I added this flag I received some errors regarding missing symbols (such as _CBAdvertisementDataManufacturerDataKey
).
I added the Accelerate
and CoreBluetooth
frameworks in *Build Phases -> Link Binary With Libraries*.
This issue is fixed in the new update of Google maps https://developers.google.com/maps/documentation/ios-sdk/releases?hl=en Check this Link and update your local repositories
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With