CocoaPods is no longer creating a Pods.xcconfig
file automatically on pod install
for my project. The file is shown in red font within the project workspace and is not in the Pods/
directory.
CocoaPods不再在我的项目的pod安装上自动创建Pods.xcconfig文件。该文件在项目工作区内以红色字体显示,不在Pods /目录中。
My Podfile
looks like this:
我的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
When I run pod install
via Terminal, no error is thrown. Strangely enough, Pods-ProjectName.xcconfig
is created.
当我通过终端运行pod安装时,不会抛出任何错误。奇怪的是,创建了Pods-ProjectName.xcconfig。
What do I need to do to fix CocoaPods
to automatically create the Pods.xcconfig
file?
我需要做些什么来修复CocoaPods以自动创建Pods.xcconfig文件?
What I've tried so far :
到目前为止我尝试了什么:
- Running
pod install
again. - Deleting
Pods/
directory,Podfile.lock
, the projectworkspace
, and runningpod install
- Verifying that all
search paths
are default values (CocoaPods help guide mentions this can cause problems otherwise?)
再次运行pod安装。
删除Pods /目录,Podfile.lock,项目工作区和运行pod安装
验证所有搜索路径都是默认值(CocoaPods帮助指南提到这可能会导致问题吗?)
1 个解决方案
#1
7
Originally, I didn't specify the target "ProjectName"
wrapper in my Podfile
. Instead, I simply had
最初,我没有在Podfile中指定目标“ProjectName”包装器。相反,我只是
# 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 ...
Hence, Pods.xcconfig
(for the universal
pod list) was created and libPods.a
was added to the Link binary with library
build stage of my ProjectName
target.
因此,创建了Pods.xcconfig(用于通用pod列表),并将libPods.a添加到具有ProjectName目标的库构建阶段的Link二进制文件中。
Later, I wrapped said block in target "ProjectName" do
, i.e.
后来,我在目标“ProjectName”中包裹了所述块,即
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
This created a Pods-ProjectName.xcconfig
, but it did not create Pods.xcconfig
(as no files belonged to the default
pod list) or libPod.a
.
这创建了一个Pods-ProjectName.xcconfig,但它没有创建Pods.xcconfig(因为没有文件属于默认的pod列表)或libPod.a。
CocoaPods also did not remove libPods.a
from the Link binary with library
build stage or Pods.xcconfig
from the workspace.
CocoaPods也没有从具有库构建阶段的Link二进制文件或工作区中的Pods.xcconfig中删除libPods.a。
This resulted in linker errors to the effect of libPods.a can not be found
.
这导致链接器错误无法找到libPods.a的效果。
To fix it, I reverted to the original target-less pod
statements (my ProjectNameTest
target needs to see these pods too) and had to manually remove libPods.a
from the Link binary with library
build stage and Pods.xcconfig
from the workspace.
为了解决这个问题,我恢复了原始的无目标pod语句(我的ProjectNameTest目标也需要查看这些pod),并且必须从工作区构建阶段的Link二进制文件和工作区中的Pods.xcconfig手动删除libPods.a。
Ideally, CocoaPods would take care of this clean up for you, and hopefully, this will be the case in the future (current version of CocoaPods as of this writing is 0.29, which requires this manual cleanup process).
理想情况下,CocoaPods将为您处理此类清理,并且希望将来会出现这种情况(截至本文撰写时,CocoaPods的当前版本为0.29,这需要此手动清理过程)。
#1
7
Originally, I didn't specify the target "ProjectName"
wrapper in my Podfile
. Instead, I simply had
最初,我没有在Podfile中指定目标“ProjectName”包装器。相反,我只是
# 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 ...
Hence, Pods.xcconfig
(for the universal
pod list) was created and libPods.a
was added to the Link binary with library
build stage of my ProjectName
target.
因此,创建了Pods.xcconfig(用于通用pod列表),并将libPods.a添加到具有ProjectName目标的库构建阶段的Link二进制文件中。
Later, I wrapped said block in target "ProjectName" do
, i.e.
后来,我在目标“ProjectName”中包裹了所述块,即
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
This created a Pods-ProjectName.xcconfig
, but it did not create Pods.xcconfig
(as no files belonged to the default
pod list) or libPod.a
.
这创建了一个Pods-ProjectName.xcconfig,但它没有创建Pods.xcconfig(因为没有文件属于默认的pod列表)或libPod.a。
CocoaPods also did not remove libPods.a
from the Link binary with library
build stage or Pods.xcconfig
from the workspace.
CocoaPods也没有从具有库构建阶段的Link二进制文件或工作区中的Pods.xcconfig中删除libPods.a。
This resulted in linker errors to the effect of libPods.a can not be found
.
这导致链接器错误无法找到libPods.a的效果。
To fix it, I reverted to the original target-less pod
statements (my ProjectNameTest
target needs to see these pods too) and had to manually remove libPods.a
from the Link binary with library
build stage and Pods.xcconfig
from the workspace.
为了解决这个问题,我恢复了原始的无目标pod语句(我的ProjectNameTest目标也需要查看这些pod),并且必须从工作区构建阶段的Link二进制文件和工作区中的Pods.xcconfig手动删除libPods.a。
Ideally, CocoaPods would take care of this clean up for you, and hopefully, this will be the case in the future (current version of CocoaPods as of this writing is 0.29, which requires this manual cleanup process).
理想情况下,CocoaPods将为您处理此类清理,并且希望将来会出现这种情况(截至本文撰写时,CocoaPods的当前版本为0.29,这需要此手动清理过程)。