我的 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'
放置在 Target
和 end
之间进行附加它到那个特定的目标。
如果您有一个没有这些目标的旧 podfile,我建议您重新开始运行 pod init
生成的新文件,但如果您愿意,可以将其重新格式化为上述格式。
关于ios - 我在 pod install Kanna 时遇到错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38412406/