You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

执行pod lint时提示无法读取许可证文件的问题求助

Troubleshooting "Unable to read the license file" Pod Lint Warning

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 your LICENSE.md file lives in the exact same root directory as your .podspec file. Pod lint looks for the license relative to the podspec's location—if it's tucked inside a subfolder like Docs or Classes, the path won't resolve correctly. You can confirm this by running ls in 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 references LICENSE.md but the actual file is named license.md or License.md, the lookup will fail. Use ls -l in 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 LICENSE to LICENSE.md, make sure you saved the podspec changes before re-running pod lint.

  • Clear CocoaPods cache
    Old cached data can sometimes cause unexpected issues. Run this command to clear all pod caches:

    pod cache clean --all
    

    Then re-run pod lint to see if the warning goes away.

  • Test file accessibility manually
    In your project root terminal, run:

    cat LICENSE.md
    

    If 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.3
    

    Then re-run pod lint to test.

内容的提问来源于stack exchange,提问作者Pooja Srinath

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.22 09:55:21