菜鸟教程小白 发表于 2022-12-11 19:37:30

ios - 从开源 repo 创建 CocoaPods 库


                                            <p><p>我想使用 <a href="https://github.com/cheind/dest" rel="noreferrer noopener nofollow">DEST library</a>在我的 iOS 应用程序中。我想通过 CocoaPods 包含它。</p>

<p>按照官方教程我这样编辑.podspec:</p>

<pre><code>Pod::Spec.new do |s|
s.name             = &#39;dest&#39;
s.version          = &#39;v0.8&#39;
s.summary          = &#39; One Millisecond Deformable Shape Tracking Library&#39;

s.description      = &lt;&lt;-DESC
Deformable Shape Tracking (DEST) is a C++ library providing high performance 2D shape tracking leveraging machine learning methods. The video below shows the real-time capabilities of DEST in annotating video sequences / still images with facial landmarks.
                     DESC

s.homepage         = &#39;https://github.com/cheind/dest&#39;
s.license          = { :type =&gt; &#39;BSD&#39;, :file =&gt; &#39;LICENSE&#39; }
s.author         = { &#39;cheind&#39; =&gt; &#39;[email protected]&#39; }
s.source         = { :git =&gt; &#39;https://github.com/cheind/dest.git&#39;, :tag =&gt; &#34;v0.8&#34; }

s.ios.deployment_target = &#39;8.0&#39;

s.source_files = &#39;dest/Classes/**/*&#39;

end
</code></pre>

<p>但是当我运行 <code>pod lib lint</code> 我有:</p>

<pre><code>### Command
</code></pre>

<p><code>
/usr/local/bin/pod lib lint
</code></p>

<h3>报告</h3>

<ul>
<li><p>你做了什么?</p></li>
<li><p>您预计会发生什么?</p></li>
<li><p>发生了什么?</p></li>
</ul>

<h3>堆栈</h3>

<p><code>
    cocoapod :1.1.1
         ruby : ruby2.0.0p648(2015-12-16 修订版 53162)
   rubygem :2.0.14.1
      主机:Mac OS X 10.12.3 (16D32)
       Xcode:8.3.2(8E2002)
         Git : git 版本 2.11.0 (Apple Git-81)
Ruby 库目录:/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib
存储库:主 - https://github.com/CocoaPods/Specs.git @ 4076e32f9f51026e071e398117df63084ee3f​​bae
</code></p>

<h3>插件</h3>

<p><code>
cocoapods-deintegrate:1.0.1
cocoapods 插件:1.0.0
cocoapods 搜索:1.0.0
cocoa 足统计:1.0.0
cocoa 足树干:1.1.1
cocoa 足试:1.1.0
</code></p>

<h3>错误</h3>

<p>```
ArgumentError - 格式错误的版本号字符串 v0.8
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-1.1.1/lib/cocoapods-core/version.rb:52:in <code>初始化'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-1.1.1/lib/cocoapods-core/vendor/version.rb:199:in</code>new'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-1.1.1/lib/cocoapods-core/vendor/version.rb:199:in <code>new'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-1.1.1/lib/cocoapods-core/specification/root_attribute_accessors.rb:31:in</code>version'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-1.1.1/lib/cocoapods-core/specification/linter.rb:109:in <code>block in check_required_attributes'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-1.1.1/lib/cocoapods-core/specification/linter.rb:108:in</code>each'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-1.1.1/lib/cocoapods-core/specification/linter.rb:108:in <code>check_required_attributes'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-1.1.1/lib/cocoapods-core/specification/linter.rb:50:in</code>lint'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/validator.rb:281:in <code>perform_linting'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/validator.rb:78:in</code>validate'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/command/lib/lint.rb:62:in <code>block in run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/command/lib/lint.rb:50:in</code>each'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/command/lib/lint.rb:50:in <code>run'
/Library/Ruby/Gems/2.0.0/gems/claide-1.0.1/lib/claide/command.rb:334:in</code>run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/command.rb:50:in <code>run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/bin/pod:55:in</code>'
/usr/local/bin/pod:23:in <code>load'
/usr/local/bin/pod:23:in</code>'</p>

<p>我做错了什么?</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>版本字符串不应包含“v”。它应该是“0.8”,而不是“v0.8”。更多关于 podspec 版本规范 <a href="https://guides.cocoapods.org/syntax/podspec.html#version" rel="noreferrer noopener nofollow">here</a> </p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 从开源 repo 创建 CocoaPods 库,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/43824724/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/43824724/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 从开源 repo 创建 CocoaPods 库