ios - 我在 pod install Kanna 时遇到错误

标签 ios swift podfile

Screen my Terminal

我的 podfile 有什么问题吗?

我将其添加到我的 Podfile 中:

use_frameworks!
pod 'Kanna', '~> 1.1.0'

附注JSON 和 Alamofire 的作品非常棒!

cocoapods 的控制台输出如下:

Analyzing dependencies    
[!] The dependency `Kanna (~> 1.1.0)` is not used in any concrete target.

最佳答案

在没有看到你的 podfile 的情况下,我只是在这里猜测,但根据我的经验,该错误意味着你的 podfile 格式不正确。最近他们对 podfile 结构进行了一些更改,因此如果您有旧的 podfile,但将 Cocoapods 更新到新版本,则您的 podfile 可能无法工作。

podfile 中的所有内容现在都需要通过将其放置在目标的 block 中来显式附加到该目标。如果您运行 pod init ,生成的 podfile 应该有几个如下所示的 block :

Target 'Your App' do

end

您还可能有您的应用 iOSTests您的应用 iOSUITests 的目标。如果您打开 Xcode,您将看到这些目标对应于项目中的顶级文件夹。

您需要将 pod 'Kanna', '~> 1.1.0' 放置在 Targetend 之间进行附加它到那个特定的目标。

如果您有一个没有这些目标的旧 podfile,我建议您重新开始运行 pod init 生成的新文件,但如果您愿意,可以将其重新格式化为上述格式。

关于ios - 我在 pod install Kanna 时遇到错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38412406/

相关文章:

ios - Xcode 6 为布局边距设置默认值或禁用它们

ios - Swift - 在用户输入时获取键盘输入

objective-c - Obj-C 到 Swift 桥接问题 : NS_ENUM -> enum

ios - 迭代字典数组的数组

reactjs - `pod install` 在 react 原生自动链接中到底做了什么?

ios - 通过单元格中的辅助功能标识符访问 UIButton

objective-c - iOS OpenGL 运行时纹理

xcode - Podfile 不安装选定的分支

android-studio - Android Studio Bumblebee 'pod install' 命令失败,异常错误=2

javascript - UIAutomation 测试计时器等到完成