【问题标题】:Enable Places API for iOS in Google Cloud Platform在 Google Cloud Platform 中启用 Places API for iOS
【发布时间】:2019-02-09 20:52:05
【问题描述】:

我正在尝试在 iOS 应用程序中添加 Place Autocomplete,但我总是收到此错误。

The operation couldn’t be completed. The Places API for iOS is not enabled. See the developer's guide (https://developers.google.com/places/ios-api/start) for how to enable the Google Places API for iOS.

我正在尝试在 Google Cloud Platform 中激活 Places API for iOS,但该选项未出现在 API 库列表中。有人知道为什么吗?我在 StackOverflow 中看到过不同的教程和帖子,但没有人解释原因。

我不知道我的帐户是否需要一些配置。

请查看随附的屏幕截图。

Xcode 错误

启用 API 和服务

API 库列表

如您所见,Places API for iOS 不在列表中。

【问题讨论】:

    标签: ios xcode google-places-api google-maps-sdk-ios


    【解决方案1】:

    我也遇到了这个问题,但发现这个answer 很有帮助。

    问题是GooglePlaces pod 没有更新。当我们运行pod install 时,GooglePlaces pod 会自动设置为版本2.7.0,但最新的是版本3.0.2

    尝试pod update GooglePlaces --verbose 时,pod 无法正确更新,所以我最终直接在podfile 上设置版本,如下所示:

      # Pods for myProject
        pod 'Alamofire', '~> 4.7'
        pod 'GoogleMaps', '~> 3.0.2'
        pod 'GooglePlaces', '~> 3.0.2'
    

    然后再次运行pod install,“api未启用”错误消失了。

    【讨论】:

    • Excellent Valery 这个解决方案解决了我的问题,现在Place Autocomplete 可以工作了,但我在 API 列表中看不到 Places API for iOS。你知道为什么吗?
    • 对此我不确定,但我相信在新版本的 api 中,Google 可能会统一地点 api,因此无需从 api 控制台单独启用平台。
    猜你喜欢
    • 2020-01-17
    • 1970-01-01
    • 1970-01-01
    • 2021-03-25
    • 1970-01-01
    • 2016-12-19
    • 1970-01-01
    • 2019-02-26
    • 1970-01-01
    相关资源
    最近更新 更多