swift - 使用未声明类型 GMSPlacesField GoogleMaps SDK Swift
问题描述
使用 GooglePlaces 自动完成 UI 时出现错误 Use of undeclared type 'GMSPlacefield'。
我在这里搜索 GMSPlaceField Error when building - Swift 4.2
我已经尝试更新我正在使用 google places 3.1.0 和 google maps 3.1.0 的 pod 文件。我已经重新启动了干净的构建。
我认为代码是很好的代码,因为它在谷歌文档的多个地方使用。 https://woolpert-googlecloud.github.io/maps-platform-best-practices/docs/place-details-fields.html
失败的特定代码行是 let fields:GMSPlaceField = GMSPlaceField(rawValue: UInt(GMSPlaceField.name.rawValue) | UInt(GMSPlaceField.placeID.rawValue))!
编译器指示使用未声明的类型 'GMSPlaceField'
解决方案
尝试更新 Pod 文件时。我得到了执行 CocoaPods 安装安装 GoogleMaps (3.1.0) 安装 GooglePlaces (3.1.0) Pod 安装完成的报告!Podfile 中有 2 个依赖项,总共安装了 2 个 pod。
但这在复活时不是真的,这表明我仍然在 2.7.0。
我更新了 pod 文件以专门调出最近的 pod 文件 pod 'GooglePlaces', '~> 3.1' pod 'GoogleMaps', '~> 3.1'
这有效并解决了问题。
推荐阅读
- java - Space&NewLine Java
- angular - 如何以角度设置动态级联下拉的值?
- python - 有没有办法在旋转和移动布尔蒙版时修复 True 值的丢失?
- sql - 需要查询以使用 max(column_name) 条件连接同一表的 2 列
- python - 读取文件名并插入数据库(使用 python 和 MSSQL)
- php - 如何在页面加载时检查空表单变量
- python - Python ImportError:确认安装后没有名为“请求”的模块
- python - Pandas:对于 df 中的每一行,计算该值在另一列中存在的次数
- python - 一旦函数返回,什么会保留对函数嵌套类的引用?
- node.js - 电子和 MLab