我正在尝试将新的 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/