CocoaPods不再为我的项目在Pods.xcconfig
上自动创建pod install
文件。该文件在项目工作区内以红色字体显示,不在Pods/
目录中。
我的Podfile
看起来像这样:
platform :ios, '7.0'
target "ProjectName" do
# Team Created Pods - kept and versioned in private spec repo
pod 'ProjectImageObject', '0.1.0'
pod 'Image+Bundle+Name', '0.1.0'
# Team Forked Pods - kept and versioned in private spec Repo
pod 'MagicalRecord', '2.2.1-pn'
pod 'KeychainItemWrapper', '0.1.0'
pod 'DCRoundSwitch', '0.1.0'
pod 'JBSignatureController', '0.1.0'
pod 'MBProgressHUD', '0.5.1-pn'
pod 'PKRevealController', '1.1.0-pn'
pod 'SMCalloutView', '2.0'
pod 'SVPullToRefresh', '0.4.2-pn'
pod 'TimesSquare', '1.1.0-pn'
pod 'XMLReader', '0.1.0'
# Third-Party Pods
pod 'Reachability', '~> 3.1.1'
pod 'AFNetworking', '~> 2.1'
pod 'TTTAttributedLabel', '~>1.8'
pod 'TPKeyboardAvoiding', '~> 1.2.3'
end
target "ProjectNameTests" do
# Team Created Pods - kept and versioned in private spec rep
pod 'SharedTestCore'
# Third-Party Pods
pod 'OCHamcrest', '~> 3.0.1'
pod 'OCMockito', '~> 1.1.0'
end
当我通过终端运行pod install
时,不会抛出任何错误。奇怪的是,Pods-ProjectName.xcconfig
已经创建。
我需要做些什么来修复CocoaPods
以自动创建Pods.xcconfig
文件?
到目前为止我尝试过的事情:
pod install
。Pods/
目录,Podfile.lock
,项目workspace
以及正在运行pod install
search paths
都是默认值(CocoaPods帮助指南提到这可能会导致问题吗?)答案 0 :(得分:7)
最初,我没有在target "ProjectName"
中指定Podfile
包装器。相反,我只是
# Team Created Pods - kept and versioned in private spec repo
pod 'ProjectImageObject', '0.1.0'
pod 'Image+Bundle+Name', '0.1.0'
# Team Forked Pods - kept and versioned in private spec Repo
pod 'MagicalRecord', '2.2.1-pn'
# ... and so on ...
因此,Pods.xcconfig
(针对universal
广告连播列表)已创建,libPods.a
已添加到Link binary with library
目标的ProjectName
构建阶段。< / p>
后来,我把这个块包裹在target "ProjectName" do
中,即
target "ProjectName" do
# Team Created Pods - kept and versioned in private spec repo
pod 'ProjectImageObject', '0.1.0'
pod 'Image+Bundle+Name', '0.1.0'
# Team Forked Pods - kept and versioned in private spec Repo
pod 'MagicalRecord', '2.2.1-pn'
# ... and so on...
end
这创建了Pods-ProjectName.xcconfig
,但它确实不创建Pods.xcconfig
(因为没有文件属于default
广告连播列表)或libPod.a
CocoaPods还从libPods.a
构建阶段或Link binary with library
从工作区中删除{{>> <{1}}。
这导致链接器错误Pods.xcconfig
。
为了解决这个问题,我恢复了原始的无目标libPods.a can not be found
语句(我的pod
目标也需要查看这些广告)并且必须从{{{{}}手动删除ProjectNameTest
1}}从工作区构建阶段和libPods.a
。
理想情况下,CocoaPods将为您处理此类清理,并且希望将来会出现这种情况(截至本文撰写时,CocoaPods的当前版本为0.29,这需要此手动清理过程)。