菜鸟教程小白 发表于 2022-12-11 16:55:07

ios - 创建私有(private)cocoapod,git标签问题


                                            <p><p>我已经成功创建了一个静态库<em>MyCore</em>,并创建了相关的存储库。<br/>
然后我以这种方式创建了 <em>MyCore.podspec</em>:</p>

<pre><code>Pod::Spec.new do |s|
    s.name         = &#34;MyCore&#34;
    s.version      = &#34;0.1.4&#34;
    s.summary      = &#34;...&#34;
    s.description= &#34;...&#34;
    s.homepage   = &#34;https://foo.com/MyCore&#34;
    s.license      = &#39;...&#39;
    s.platform   = :ios, &#34;8.0&#34;
    s.source       = { :git =&gt; &#34;https://foo.com/MyCore.git&#34;, :tag =&gt; s.version.to_s }
    s.source_files= &#39;MyCore/*.swift&#39;
end
</code></pre>

<p>我跑</p>

<pre><code>pod spec lint --allow-warnings
</code></pre>

<p>并且 podspec 通过了验证。</p>

<p>很好,比在我的项目中我有 podfile:</p>

<pre><code>source &#39;https://github.com/CocoaPods/Specs.git&#39;

platform :ios, &#39;8.0&#39;
use_frameworks!
inhibit_all_warnings!

target &#39;MyProject&#39; do

    pod &#39;MyCore&#39;, :git =&gt; &#39;https://foo.com/MyCore.git&#39;

end
</code></pre>

<p>当我运行 <strong>'pod install'</strong> 时,我的 pod 已安装,但没有像我预期的那样在最后一个标签 <strong>(0.1.4)</strong> 处安装:</p>

<pre><code>Installing MyCore 0.1.0
</code></pre>

<p>有什么想法吗?</p>

<p> <a href="/image/fbF4n.png" rel="noreferrer noopener nofollow"><img src="/image/fbF4n.png" alt="enter image description here"/></a> </p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>对于未存储在规范存储库中的私有(private) pod,Cocoapods 无法找到用于比较版本号的引用。</p>

<p>然后运行以下命令强制更新。</p>

<pre><code>pod update
</code></pre></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 创建私有(private)cocoapod,git标签问题,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/38225902/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/38225902/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 创建私有(private)cocoapod,git标签问题