pod 'RxGoogleMaps'我正在尝试安装上面的库,而不安装它的子规范s.dependency 'GoogleMaps', '~> 3'
这是因为由于我们架构的本质(iOS模块化架构),我必须手动链接GoogleMaps (因为它是一个静态库)。
现在,当我尝试安装RxGoogleMaps时,CocoaPods尝试将GoogleMaps作为子依赖项安装,但得到一个错误,因为它已经存在并链接。
有没有办法阻止这个子依赖项的安装?
发布于 2020-09-25 05:59:37
您无法真正避免它被下载,但是您可以将它从xcconfig文件中删除,通过向Podfile添加安装后脚本来避免它被链接
如下所示:
require 'fileutils'
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
if config.base_configuration_reference
xcconfig_path = config.base_configuration_reference.real_path
xcconfig = File.read(xcconfig_path)
new_xcconfig = xcconfig.sub("-framework \"GoogleMaps\"", "")
File.open(xcconfig_path, "w") { |file| file << new_xcconfig }
end
end
end
endhttps://stackoverflow.com/questions/64046118
复制相似问题