【问题标题】:Failed to load optimized model at path error with Google Maps API using Xcode 7 / iOS9使用 Xcode 7 / iOS9 使用 Google Maps API 加载路径错误时无法加载优化模型
【发布时间】:2015-12-16 18:20:57
【问题描述】:

我正在尝试在我的代码中使用 Google Places API 自动完成功能。

    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)")
                }
            }
        })

    }
}

当我运行它时,我收到了这个错误:CoreData: Failed to load optimized model at path '/var/mobile/Containers/Bundle/Application/ 有什么想法吗?

【问题讨论】:

标签: google-places-api swift2 ios9


【解决方案1】:

-ObjC添加到“Other Linker Flags

(Build Settings -> Linking -> Other Linker Flags). 

这为我解决了这个问题。

添加此标志后,我收到了一些关于缺少符号的错误(例如 _CBAdvertisementDataManufacturerDataKey)。

我在 *Build Phases -> Link Binary With Libraries*.

中添加了 AccelerateCoreBluetooth 框架

【讨论】:

    【解决方案2】:

    此问题已在 Google 地图的新更新中修复 https://developers.google.com/maps/documentation/ios-sdk/releases?hl=en 检查此链接并更新您的本地存储库

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-02-28
      • 2015-12-19
      • 2019-11-16
      • 2018-04-03
      • 2019-03-01
      • 1970-01-01
      相关资源
      最近更新 更多