HTML5   发布时间:2022-04-27  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了ios – 为CocoaPods的pod设置部署目标大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我使用 CocoaPods来管理项目中的依赖关系.我写了Podfile:
target 'MyApp' do
  platform :ios,'8.0'
  # Uncomment this line if you're using Swift or would like to use dynamic frameworks
  #use_frameworks!

  # Pods for MyApp
  pod 'KeepLayout',:git => 'https://github.com/iMartinKiss/KeepLayout',:tag => 'v1.6.0'
  pod 'EasyMapping'

  target 'MyAppTests' do
    inherit! :search_paths
    # Pods for testing
  end

  target 'MyAppUITests' do
    inherit! :search_paths
    # Pods for testing
  end

end

文件与CocoaPods 0.x配合使用,但在我更新到CocoaPods 1.0之后,我无法编译项目.运行后

pod update

我无法编译我的项目错误

我看到每个库都是用不同的部署目标构建的.例如,KeepLayout由4.3部署目标构建.

我如何确定每个pod依赖关系的构建目标?

解决方法

虽然CocoaPods的一些开发版本(以及1.0版之前版本)可能会将项目的部署目标传播到pod,但这是 no longer the case in 1.0.为了解决这个问题,the current developer recommends使用后安装钩子.

这是一种强制性的方法来强制生成的Pods项目中每个pod的硬编码部署目标.将其粘贴到您的Podfile结尾:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.2'
    end
  end
end

大佬总结

以上是大佬教程为你收集整理的ios – 为CocoaPods的pod设置部署目标全部内容,希望文章能够帮你解决ios – 为CocoaPods的pod设置部署目标所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: