将pod与所有目标集成

将pod与所有目标集成

本文介绍了将pod与所有目标集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用我的iOS应用程序已经使用CocoaPods几周了,它与我测试的一个目标(我们称之为MainApp)完美配合。但是,我现在想要构建一个不同的目标(MyAppLite)并注意到构建失败(在其中一个pod的头文件中找不到文件)。



我注意到的构建设置的差异如下:




  • 其他链接器标志不包含MyAppLite中所需的框架

  • MyAppLite中的框架/标题/库搜索路径都是空的

  • MyAppLite中没有MainApp中的用户定义构建设置



如何确保在运行 pod install 时,所有目标都链接了库? / p>

作为参考,这是我的Podfile:

  platform:ios, '5.0'

pod'TTTAttributedLabel','〜> 1.7.0'
pod'iRate','〜> 1.7.5'
pod'MBProgressHUD','〜> 0.6'
pod'FlurrySDK','〜> 4.2.3'
pod'ACSimpleKeychain','〜> 0.0.1'
pod'WEPopover','〜> 0.0.1'
pod'AFNetworking','〜> 1.3.1'
pod'Nimbus','〜> 1.0.0'
pod'QuincyKit','〜> 2.1.9'


解决方案

使用CocoaPods 0.x



您可以使用 link_with 指令

  platform:ios,'5.0'

pod'TTTAttributedLabel','〜> 1.7.0'
pod'iRate','〜> 1.7.5'
pod'MBProgressHUD','〜> 0.6'
pod'FlurrySDK','〜> 4.2.3'
pod'ACSimpleKeychain','〜> 0.0.1'
pod'WEPopover','〜> 0.0.1'
pod'AFNetworking','〜> 1.3.1'
pod'Nimbus','〜> 1.0.0'
pod'QuincyKit','〜> 2.1.9'

link_withMyApp
link_withMyAppLite

这将生成 libPods.a ,它会将其链接到 Target1 Target1



相关:






使用CocoaPods 1.x



参见其他答案。


I have been using CocoaPods for a few weeks now with my iOS app and it works perfectly with the one target I have been testing (let's call it "MainApp"). However, I now want to build a different target ("MyAppLite") and noticed that the build failed (file not found on one of the pods' header files).

The differences in the Build Settings I've noticed are as follows:

  • Other Linker Flags does not contain the required frameworks in MyAppLite
  • Framework/Header/Library Search Paths are all empty in MyAppLite
  • None of the User-Defined Build Settings in MainApp are present in MyAppLite

How can I ensure that when I run pod install, all targets have the libraries linked?

For reference, here is my Podfile:

platform :ios, '5.0'

pod 'TTTAttributedLabel', '~> 1.7.0'
pod 'iRate', '~> 1.7.5'
pod 'MBProgressHUD', '~> 0.6'
pod 'FlurrySDK', '~> 4.2.3'
pod 'ACSimpleKeychain', '~> 0.0.1'
pod 'WEPopover', '~> 0.0.1'
pod 'AFNetworking', '~> 1.3.1'
pod 'Nimbus', '~> 1.0.0'
pod 'QuincyKit', '~> 2.1.9'
解决方案

With CocoaPods 0.x

You can use the link_with directive

platform :ios, '5.0'

pod 'TTTAttributedLabel', '~> 1.7.0'
pod 'iRate', '~> 1.7.5'
pod 'MBProgressHUD', '~> 0.6'
pod 'FlurrySDK', '~> 4.2.3'
pod 'ACSimpleKeychain', '~> 0.0.1'
pod 'WEPopover', '~> 0.0.1'
pod 'AFNetworking', '~> 1.3.1'
pod 'Nimbus', '~> 1.0.0'
pod 'QuincyKit', '~> 2.1.9'

link_with "MyApp"
link_with "MyAppLite"

This will produce libPods.a and it will link it to Target1 and Target1.

Relevant documentation:


With CocoaPods 1.x

See other answers.

这篇关于将pod与所有目标集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-24 04:55