我正在尝试在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中看到了不同的教程和帖子,但没有人解释原因。
我不知道我的帐户是否需要一些配置。
请参阅附带的屏幕截图。
如你所见,Places API for iOS
不在列表中。
我也遇到了这个问题,但发现这个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未启用”错误消失了。