菜鸟教程小白 发表于 2022-12-13 09:28:59

ios - 使用 CocoaPods 在 iOS 中安装 Google Analytics 时出错


                                            <p><p>我正在尝试通过 cocoapod 安装 Google Analytics,但这不可能,我总是收到此错误:</p>

<pre><code>Resolving dependencies of `Podfile`
[!] Unable to satisfy the following requirements:

- `Google/Analytics (~&gt; 1.0.0)` required by `Podfile`

/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/lib/cocoapods/resolver.rb:388:in `handle_resolver_error&#39;
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/lib/cocoapods/resolver.rb:69:in `rescue in resolve&#39;
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/lib/cocoapods/resolver.rb:56:in `resolve&#39;
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/lib/cocoapods/installer/analyzer.rb:535:in `block in resolve_dependencies&#39;
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/lib/cocoapods/user_interface.rb:59:in `section&#39;
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/lib/cocoapods/installer/analyzer.rb:533:in `resolve_dependencies&#39;
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/lib/cocoapods/installer/analyzer.rb:70:in `analyze&#39;
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/lib/cocoapods/installer.rb:210:in `analyze&#39;
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/lib/cocoapods/installer.rb:133:in `block in resolve_dependencies&#39;
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/lib/cocoapods/user_interface.rb:59:in `section&#39;
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/lib/cocoapods/installer.rb:132:in `resolve_dependencies&#39;
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/lib/cocoapods/installer.rb:104:in `install!&#39;
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/lib/cocoapods/command/project.rb:71:in `run_install_with_update&#39;
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/lib/cocoapods/command/project.rb:101:in `run&#39;
/Library/Ruby/Gems/2.0.0/gems/claide-0.9.1/lib/claide/command.rb:312:in `run&#39;
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/lib/cocoapods/command.rb:48:in `run&#39;
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/bin/pod:44:in `&lt;top (required)&gt;&#39;
/usr/bin/pod:23:in `load&#39;
/usr/bin/pod:23:in `&lt;main&gt;&#39;
</code></pre>

<p>我的 podfile 已经包含不同的 pod 和一个私有(private) pod:</p>

<pre><code>platform :ios, &#34;6.0&#34;

source &#39;[email protected]:MyCompany/myCompany-cocoaPods-ios.git&#39;
source &#39;https://github.com/CocoaPods/Specs.git&#39;

target &#34;MyTarget&#34; do

pod &#39;OpenWeatherMapAPI&#39;, &#39;~&gt; 0.0.5&#39;
pod &#39;INCore&#39;, &#39;~&gt;1.1.0&#39;
pod &#39;AFNetworking&#39;, &#39;&gt;= 1.3.1&#39;
pod &#39;Google/Analytics&#39;, &#39;~&gt; 1.0.0&#39;

end
</code></pre>

<p>有什么我可以尝试的想法吗?谢谢</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>尝试在项目build设置中使用 iOS 7.0 作为部署目标。</p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 使用 CocoaPods 在 iOS 中安装 Google Analytics 时出错,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/31744493/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/31744493/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 使用 CocoaPods 在 iOS 中安装 Google Analytics 时出错