我的 podfile 有什么问题?
我将它添加到我的 Podfile 中:
use_frameworks!
pod 'Kanna', '~> 1.1.0'
PS 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 中的所有内容现在都需要通过将其放置在目标的块中来显式附加到目标。如果你运行pod init
生成的 podfile,应该有几个块,如下所示:
Target 'Your App' do
end
您可能还具有Your App iOSTests
和的目标Your App iOSUITests
。如果您打开 Xcode,您会看到这些目标对应于您项目中的顶级文件夹。
您需要在和pod 'Kanna', '~> 1.1.0'
之间放置以将其附加到该特定目标。Target
end
如果您有一个没有这些目标的旧 podfile,我建议您从运行生成的新 podfile 重新开始pod init
,但如果您愿意,您可以将其重新格式化为上述格式。