更新 CocoaPod

Updating a CocoaPod

我在 xcode 工作区中使用 GoogleMaps pod。

大约一年前我按照 https://developers.google.com/maps/documentation/ios-sdk/start#step_1_get_the_latest_version_of_xcode 进行设置。

我有一台新电脑,当我打开我的工作区项目时,我得到

Podfile.lock: No such file or directory
Manifest.lock: No such file or directory
"The sandbox is not in sync with the Podfile.lock. Run pod install or update your Cocoapods installation.

我更新了我的 cocoapods 安装。

然后我 运行 pod 更新。还有 pod 安装。在这两种情况下,我都会继续收到一条消息:

 ! The dependency 'GoogleMaps' is not used in any concrete target.

我正在使用的播客文件:

source 'https://github.com/CocoaPods/Specs.git'
pod 'GoogleMaps'

最后,我尝试删除 podfile 和 Pods 文件夹以及 运行 pod install,但我仍然收到该错误消息。我已经尝试使用 8.1 和 9.0 的平台 ios 目标。

通过在你的系统上重新安装 cocoapods,我猜你下载了它的更新版本,所以 Podfile 语法改变了一点,你缺少的是目标,你可以阅读更多关于这个 here

所以在你的情况下它会是这样的:

source 'https://github.com/CocoaPods/Specs.git'

target 'App target'
pod 'GoogleMaps'

只是 运行 pod install 之后就这样了。