菜鸟教程小白 发表于 2022-12-11 20:09:20

ios - iOS 上的 GeoFire 与 Firebase 5


                                            <p><p>从 Firebase 4.x 到 Firebase 5.0.0 的更新破坏了我的 GeoFire 安装。我正在通过“Podfile”安装 GeoFire,如下所示:</p>

<pre><code>pod &#39;GeoFire&#39;, :git =&gt; &#39;https://github.com/firebase/geofire-objc.git&#39;
</code></pre>

<p>我现在收到此错误消息:</p>

<blockquote>
<p>[!] CocoaPods could not find compatible versions for pod
&#34;Firebase/Database&#34;: In Podfile: Firebase/Database</p>

<p>GeoFire (from <code>https://github.com/firebase/geofire-objc.git</code>) was
resolved to 2.0.1, which depends on   Firebase/Database (~&gt; 4.0) Specs
satisfying the Firebase/Database, Firebase/Database (~&gt; 4.0)
dependency were found, but they required a higher minimum deployment
target.</p>
</blockquote>

<p>Podfile 和 Xcode 项目中的部署目标是 iOS 11。所以确实没有更高的最低部署目标。</p>

<p>在本地克隆 repo 并将安装更改为 </p>

<pre><code>pod &#39;GeoFire&#39;, :path =&gt; &#39;/Users/georg/Projekte/Repos/geofire-objc&#39;
</code></pre>

<p>并且提高对 Firebase 5.0 的依赖似乎也不起作用,因为我现在收到错误消息</p>

<blockquote>
<p>[!] The &#39;Pods-poifinder&#39; target has transitive dependencies that
include static frameworks: (FirebaseDatabase, FirebaseCore,
FirebaseAuth, FirebaseFirestore, FirebaseFunctions, and
FirebaseStorage)</p>
</blockquote>

<p>Firebase 已切换到 v5.0.0 的源 pod,这可能是对此的解释。</p>

<p>我现在的问题是:如何让 GeoFire 在 Swift 4.1 项目中使用 Firebase 5.0。谢谢!</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>在存储库中修复此问题之前,您可以使用此解决方法:</p>

<ol>
<li>在本地克隆存储库</li>
<li><p>编辑你的 podfile 并像这样指向本地存储库</p>

<p>pod 'GeoFire', :path => '/Users/hans/repos/geofire-objc'</p></li>
<li><p>在本地存储库的“GeoFire.podspec”中像这样编辑依赖项</p>

<p>s.ios.dependency 'Firebase/Database', '~> 5.0'</p></li>
<li><p>将此行添加到“GeoFire.podspec”:</p>

<p>s.static_framework = true</p></li>
<li><p>运行</p>

<p>pod 更新</p></li>
</ol></p>
                                   
                                                <p style="font-size: 20px;">关于ios - iOS 上的 GeoFire 与 Firebase 5,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/50294424/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/50294424/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - iOS 上的 GeoFire 与 Firebase 5