执行pod lint时提示无法读取许可证文件的问题求助
Hey there, let's work through this license file issue you're facing with your podspec! I've dealt with similar headaches before, so here are some actionable steps to fix that warning:
Double-check the license file's location
Make sure yourLICENSE.mdfile lives in the exact same root directory as your.podspecfile. Pod lint looks for the license relative to the podspec's location—if it's tucked inside a subfolder likeDocsorClasses, the path won't resolve correctly. You can confirm this by runninglsin your project's root terminal to see if the file shows up alongside your podspec.Verify filename exactness (case sensitivity)
Even though macOS is generally case-insensitive, CocoaPods can be strict about matching filenames. If your podspec referencesLICENSE.mdbut the actual file is namedlicense.mdorLicense.md, the lookup will fail. Usels -lin terminal to check the exact filename spelling and case.Check for path typos in your podspec
Your current line is:s.license = { :type => 'New BSD', :file => 'LICENSE.md' }Ensure there are no extra spaces or typos in the filename. If you recently renamed the file from
LICENSEtoLICENSE.md, make sure you saved the podspec changes before re-runningpod lint.Clear CocoaPods cache
Old cached data can sometimes cause unexpected issues. Run this command to clear all pod caches:pod cache clean --allThen re-run
pod lintto see if the warning goes away.Test file accessibility manually
In your project root terminal, run:cat LICENSE.mdIf this command fails (says "No such file or directory"), the problem is with the file itself—either it's missing or you have permission issues. If it works, the issue lies with CocoaPods.
Consider upgrading CocoaPods (if compatible)
You're using CocoaPods 1.4.0, which is quite an old version. There might be known bugs related to license file resolution that were fixed in later releases. Since you're on Xcode 9.2 and Ruby 2.5.0, try installing a newer but compatible version (like 1.11.3):gem install cocoapods -v 1.11.3Then re-run
pod lintto test.
内容的提问来源于stack exchange,提问作者Pooja Srinath

