简体   繁体   English

由于 Xcode 错误导致的 pod 规范 lint 验证错误

[英]pod spec lint validation error due to Xcode errors

I have successfully pushed my pod to CocoaPods two three days ago with version number 0.1.0.两天前,我已经成功地将我的 pod 推送到 CocoaPods,版本号为 0.1.0。 Yesterday I had to add some new features to the pod, so I have made changes in Xcode, Created multiple Swift files, modified existing code.昨天我不得不向 pod 添加一些新功能,因此我在 Xcode 中进行了更改,创建了多个 Swift 文件,修改了现有代码。

Then I know that, this version should go out as a new tag.然后我知道,这个版本应该作为一个新标签出来。 So I have created a new tag 0.1.1.所以我创建了一个新标签 0.1.1。 and pushed changes to remote repo in GitHub.并将更改推送到 GitHub 中的远程存储库。 Also changed tag in podspec file.还更改了 podspec 文件中的标签。 GitHub master repo and 0.1.1 has the same code which is equal to the local code. GitHub master repo 和 0.1.1 具有相同的代码,与本地代码相同。 And there are no warnings or errors in Xcode, everything was perfect. Xcode 中没有警告或错误,一切都很完美。

Then I have to test my pod, I ran pod lib lint , which successfully passed validation.然后我必须测试我的 pod,我运行了pod lib lint ,它成功地通过了验证。 When I ran pod spec lint , it gave me multiple Xcode errors and warnings which I have solved hours ago.当我运行pod spec lint ,它给了我多个 Xcode 错误和警告,我已经在几个小时前解决了这些错误和警告。

As I could see that pod spec lint is not looking into current swift files or into newly modified code.正如我所看到的, pod spec lint没有查看当前的 swift 文件或新修改的代码。 It shown errors and warnings related old code, And podspec file has proper version and tag.它显示了与旧代码相关的错误和警告,并且 podspec 文件具有正确的版本和标签。 Remote repo is up to date in master and also in 0.1.1.远程仓库在 master 和 0.1.1 中都是最新的。

What could be the possible solution for this?可能的解决方案是什么? Why this is happening?为什么会发生这种情况? My Xcode swift files have completely changed but pod spec lint is pointing to some old code, How?我的 Xcode swift 文件已完全更改,但pod spec lint指向一些旧代码,如何?

Is it due CocoaPods cache problem ?是因为 CocoaPods 缓存问题吗?

找到 cocoapods 工作目录,将其删除,然后再次尝试 lint:

$ find /private/var/folders -type d -name CocoaPods 2>/dev/null -exec rm -rf {} \;

got the same problem, cocoapods cache is here:遇到同样的问题,cocoapods 缓存在这里:

cd /Users/<#ur user name#>/Library/Caches/CocoaPods/Pods 

just delete /Pods directory and pod lint will work只需删除 /Pods 目录,pod lint 即可工作

or

pod cache clean YOUR_POD_NAME

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM