xcode - Podfile PXGoogleDirections 和 GoogleMaps 名称冲突

标签 xcode swift cocoapods

我正在尝试将新的 pod (PXGoogleDirections) 安装到我已经安装了 GoogleMaps pod 的现有 xcode 项目。

platform :ios, '8.0'
use_frameworks!

target 'Roadtrip' do
  pod 'GoogleMaps'
  pod 'PXGoogleDirections'
end

target 'RoadtripTests' do

end

target 'RoadtripUITests' do

end

当我运行“pod install”时,出现错误:“[!] 'PROJECT' 目标具有名称冲突的框架:GoogleMaps。”

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

我已经尝试使用与 PXGoogleDirections 使用的相同的 GoogleMaps 版本,如下所示:

pod 'GoogleMaps', '1.10.4'

但我遇到了同样的错误。

感谢您的帮助。

最佳答案

这是因为 PXGoogleDirections 本身与 GoogleMaps 捆绑在一起。在 PXGoogleDirections 的文档中说明了使用 googlemaps 的方法。 检查这个

If your app also requires the Google Maps iOS SDK, you might run into troubles because of conflicts with the bundled Google Maps iOS SDK in the Cocoapod. If you happen to face these problems, please try to do the following:

Add -framework "GoogleMaps" to the "Other Linker Flags" of your Xcode project. Make sure you are linking your app with all the libraries and frameworks required by the Google Maps iOS SDK. For a full list, see here: https://github.com/CocoaPods/Specs/blob/master/Specs/GoogleMaps/1.10.4/GoogleMaps.podspec.json Also make sure that your app contains the GoogleMaps.bundle in the "Copy Bundle Resources" phase of the build process. If it doesn't, you can manually add it to Xcode by browsing to the following directory in the Finder: /Pods/PXGoogleDirections/Dependencies/GoogleMaps.framework/Resources/GoogleMaps.bundle. Drop it in the "Frameworks" group of your project and uncheck the "Copy" checkbox.

直接链接 https://github.com/poulpix/PXGoogleDirections#in-case-of-problems

关于xcode - Podfile PXGoogleDirections 和 GoogleMaps 名称冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35262304/

相关文章:

swift - myLabel 显示错误的名称(UIDatePicker)

swift - Xcode segues 不工作

ios - 不知道在哪里添加pod文件flutter ios安装

ios - 通过 cocoapods 在 swift 项目(iOS 8.0 目标)中添加 Facebook Pop 是不可能的

xcode - 当单元测试失败时,构建不会被标记为不稳定

iphone - 检查仪器中的内存分配

ios - 快速动画循环进度 View (计时器)

swift - 给定两个点,我如何确定一个矩形是否会通过连接这些点的线

swift - Cocoapod podspec 上的预处理器标志

ios - XCode 单元测试 : Error while reading test scope bundle