首页 > 解决方案 > 使用 Ionic 4 和 cordova google 插件构建 iOS

问题描述

当我尝试将 ios 作为新平台添加到我正在工作的 android ionic 4 应用程序中时,我收到大量这些消息:

[!] 找到多个规范GoogleDataTransport (3.2.0): - /Users/haraldwiesinger/.cocoapods/repos/cocoapods/Specs/0/6/a/GoogleDataTransport/3.2.0/GoogleDataTransport.podspec.json - /Users/haraldwiesinger/.cocoapods/repos /trunk/Specs/0/6/a/GoogleDataTransport/3.2.0/GoogleDataTransport.podspec.json

[!] 找到多个规范GoogleUtilities (6.4.0): - /Users/haraldwiesinger/.cocoapods/repos/cocoapods/Specs/0/8/4/GoogleUtilities/6.4.0/GoogleUtilities.podspec.json - /Users/haraldwiesinger/.cocoapods/repos /trunk/Specs/0/8/4/GoogleUtilities/6.4.0/GoogleUtilities.podspec.json

在这些科尔多瓦插件中从 github 的现有票证中阅读了很长时间之后。我发现这与谷歌服务的不兼容版本和插件正在使用的 pod 文件有关。

我正在使用cordova-plugin-firebasexcordova-plugin-googleplus

其他人的解决方案是在他们的 ios 文件夹中运行 pod update 和 pod install .. 但我无法创建导致这些错误的平台原因.. 所以我无法在那里运行命令。

我也尝试更新 plugin.xml 的版本: <pod name="GoogleUtilities" spec="~> 6.13.0"/> 从两个插件到相同的值,但错误仍然存​​在

有人知道如何解决这个问题吗?

标签: firebasecordovacocoapodscordova-pluginsionic4

解决方案


找到解决方法:

文件:插件/cordova-plugin-googleplus/plugin.xml

<podspec>
      <config>
        <source url="https://cdn.cocoapods.org/"/>
      </config>
      <pods use-frameworks="true">
        <pod name="GoogleSignIn" spec="~> 4.4.0"/>
        <pod name="GoogleUtilities" spec="~> 6.4.0"/>
      </pods>
    </podspec>

推荐阅读