1.库中类冲突问题
项目中使用了GTExtensionSDK 与个推sdk
普通导入 会把 GTExtensionSDK 也导入到 项目中,会报错
解决1 使用: https://docs.getui.com/getui/question/ios/
####### 解决2 修改xcconfig 中的GTExtensionSDK
#删除GTExtensionSDK冲突
if target.name == "Pods-xxxx"
xcconfig_path = config.base_configuration_reference.real_path
update_xcconfig(xcconfig_path, 'FRAMEWORK_SEARCH_PATHS', '"${PODS_ROOT}/GTExtensionSDK"')
update_xcconfig(xcconfig_path, 'OTHER_LDFLAGS', ' -framework "GTExtensionSDK"')
end
# 修改xcconfig文件
def update_xcconfig(xcconfig_path, key, value)
build_settings = Hash[*File.read(xcconfig_path).lines.map{|x| x.delete!("\n").split(/\s*=\s*/, 2)}.flatten]
if !build_settings.has_key?(key)
return
end
tmpValue = build_settings[key]
# puts tmpValue.class
tmpValue = tmpValue.sub(value, "")
build_settings[key] = tmpValue
File.open(xcconfig_path, "w+") {|file|
build_settings.each do |k, v|
file.puts "#{k} = #{v}"
end
}
end