简体   繁体   English

CocoaPods没有在pod安装上创建Pods.xcconfig

[英]CocoaPods not creating Pods.xcconfig on pod install

CocoaPods is no longer creating a Pods.xcconfig file automatically on pod install for my project. CocoaPods不再在我的项目的pod install上自动创建Pods.xcconfig文件。 The file is shown in red font within the project workspace and is not in the Pods/ directory. 该文件在项目工作区内以红色字体显示,不在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. 当我通过终端运行pod install ,不会抛出任何错误。 Strangely enough, Pods-ProjectName.xcconfig is created. 奇怪的是,创建了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. 再次运行pod install
  • Deleting Pods/ directory, Podfile.lock , the project workspace , and running pod install 删除Pods/目录, Podfile.lock ,项目workspace和运行pod install
  • Verifying that all search paths are default values (CocoaPods help guide mentions this can cause problems otherwise?) 验证所有search paths都是默认值(CocoaPods帮助指南提到这可能会导致问题吗?)

Originally, I didn't specify the target "ProjectName" wrapper in my Podfile . 最初,我没有在Podfile指定target "ProjectName"包装器。 Instead, I simply had 相反,我只是

# 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 (用于universal窗格列表),并将libPods.a添加到Link binary with library ProjectName目标的Link binary with library构建阶段的Link binary with library

Later, I wrapped said block in target "ProjectName" do , ie 后来,我在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

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 (因为没有文件属于default荚列表)或libPod.a

CocoaPods also did not remove libPods.a from the Link binary with library build stage or Pods.xcconfig from the workspace. 的CocoaPods也没有删除libPods.aLink binary with library构建阶段或Pods.xcconfig从工作区。

This resulted in linker errors to the effect of libPods.a can not be found . 这导致链接器错误libPods.a can not be found的效果。

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目标需要看到这些荚太),并且必须手动删除libPods.aLink binary with library构建阶段, Pods.xcconfig从工作区。

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,这需要此手动清理过程)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM