菜鸟教程小白 发表于 2022-12-13 09:08:55

ios - pod spec lint 失败并显示 400


                                            <p><p>我遵循了 <a href="https://guides.cocoapods.org/making/using-pod-lib-create" rel="noreferrer noopener nofollow">https://guides.cocoapods.org/making/using-pod-lib-create</a> 中的所有步骤使我的开源库在 cocoapds 上可用。
在发布前的步骤结束时运行 <code>pod lib lint</code> 命令,它通过了测试:</p>

<pre><code> -&gt; SHMultipleSelect (0.1.0)

SHMultipleSelect passed validation.
</code></pre>

<p>但是 <code>pod spec lint</code> 命令给出了一些错误:</p>

<pre><code>[!] /usr/bin/git clone https://github.com/&lt;GITHUB_USERNAME&gt;/SHMultipleSelect.git /var/folders/fn/49fp5hx941541w0ncv5n28_h0000gn/T/d20150723-39741-1esoisq --single-branch --depth 1 --branch 0.1.0

Cloning into &#39;/var/folders/fn/49fp5hx941541w0ncv5n28_h0000gn/T/d20150723-39741-1esoisq&#39;...
fatal: unable to access &#39;https://github.com/&lt;GITHUB_USERNAME&gt;/SHMultipleSelect.git/&#39;: The requested URL returned error: 400
</code></pre>

<p>通过stackoverflow搜索错误,发现<a href="https://stackoverflow.com/questions/30073705/can-not-update-my-pod-library" rel="noreferrer noopener nofollow">Can not update my pod library</a> .
按照接受的答案运行 <code>pod spec lint SHMultipleSelect.podspec</code> 命令,它给了我另一个错误:</p>

<pre><code>[!] /usr/bin/git clone https://github.com/Shamsiddin/SHMultipleSelect.git /var/folders/fn/49fp5hx941541w0ncv5n28_h0000gn/T/d20150723-39842-774kfl --single-branch --depth 1 --branch 0.1.0

Cloning into &#39;/var/folders/fn/49fp5hx941541w0ncv5n28_h0000gn/T/d20150723-39842-774kfl&#39;...
warning: Could not find remote branch 0.1.0 to clone.
fatal: Remote branch 0.1.0 not found in upstream origin
Unexpected end of command stream
</code></pre>

<p>不清楚解决我的问题。谁能告诉我去哪里?</p>

<p>这是我的库 Git 网址:<a href="https://github.com/Shamsiddin/SHMultipleSelect" rel="noreferrer noopener nofollow">https://github.com/Shamsiddin/SHMultipleSelect</a> </p>

<p>还有我图书馆的 .podspec 文件:</p>

<pre><code>#
# Be sure to run `pod lib lint SHMultipleSelect.podspec&#39; to ensure this is a
# valid spec and remove all comments before submitting the spec.
#
# Any lines starting with a # are optional, but encouraged
#
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#

Pod::Spec.new do |s|
s.name             = &#34;SHMultipleSelect&#34;
s.version          = &#34;0.1.0&#34;
s.summary          = &#34;An easy-to-use multiple selection view.&#34;
s.description      = &lt;&lt;-DESC
                     An easy-to-use multiple selection view for iOS 7+.
                     DESC
s.homepage         = &#34;https://github.com/Shamsiddin/SHMultipleSelect&#34;
# s.screenshots   = &#34;www.example.com/screenshots_1&#34;, &#34;www.example.com/screenshots_2&#34;
s.license          = &#39;MIT&#39;
s.author         = { &#34;Shamsiddin&#34; =&gt; &#34;[email protected]&#34; }
s.source         = { :git =&gt; &#34;https://github.com/Shamsiddin/SHMultipleSelect.git&#34;, :tag =&gt; s.version.to_s }
# s.social_media_url = &#39;https://twitter.com/Shamsiddin_Said&#39;

s.platform   = :ios, &#39;7.0&#39;
s.requires_arc = true

s.source_files = &#39;Pod/Classes/**/*&#39;
s.resource_bundles = {
    &#39;SHMultipleSelect&#39; =&gt; [&#39;Pod/Assets/*.png&#39;]
}

# s.public_header_files = &#39;Pod/Classes/**/*.h&#39;
# s.frameworks = &#39;UIKit&#39;, &#39;MapKit&#39;
# s.dependency &#39;AFNetworking&#39;, &#39;~&gt; 2.3&#39;
end
</code></pre>

<p><strong>编辑 1:</strong></p>

<p>原来我没有在我的 Github 存储库中创建标签。我创建了版本为 <code>0.1.0</code> 的标签并再次运行 <code>pod spec lint SHMultipleSelect.podspec</code> 命令。现在它给了我另一个错误:</p>

<pre><code> -&gt; SHMultipleSelect (0.1.0)
    - ERROR | The `source_files` pattern did not match any file.

Analyzed 1 podspec.

[!] The spec did not pass validation, due to 1 error.
</code></pre>

<p><strong>编辑 2:</strong></p>

<p>添加了我的项目结构的屏幕截图:
<a href="/image/xD2b1.png" rel="noreferrer noopener nofollow"><img src="/image/xD2b1.png" alt="enter image description here"/></a> </p>

<p><strong>编辑 3:</strong></p>

<p>添加了我在光盘上的项目结构的屏幕截图。该结构是使用 <code>pod lib create SHMultipleSelect</code> 命令创建的
<a href="/image/jlJ3v.png" rel="noreferrer noopener nofollow"><img src="/image/jlJ3v.png" alt="enter image description here"/></a> </p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>很高兴帮助您解决最初的问题。关于您编辑的问题,“Pod/Classes/**/*”中似乎没有文件。此文件路径应相对于 pod 规范指定,并且应包含文件。在您的 podspec 所在的文件夹中是否有一个名为 Pod 的文件夹?</p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - pod spec lint 失败并显示 400,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/31589131/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/31589131/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - pod spec lint 失败并显示 400