Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CocoaPods not creating Pods.xcconfig on pod install

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.

My Podfile looks like this:

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.

What do I need to do to fix CocoaPods to automatically create the Pods.xcconfig file?

What I've tried so far :

  • Running pod install again.
  • Deleting Pods/ directory, Podfile.lock, the project workspace, and running pod install
  • Verifying that all search paths are default values (CocoaPods help guide mentions this can cause problems otherwise?)
like image 501
JRG-Developer Avatar asked Feb 13 '23 18:02

JRG-Developer


1 Answers

Originally, I didn't specify the target "ProjectName" wrapper in my Podfile. 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.

Later, I wrapped said block in target "ProjectName" do, i.e.

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.

CocoaPods also did not remove libPods.a from the Link binary with library build stage or Pods.xcconfig from the workspace.

This resulted in linker errors to the effect of 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.

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).

like image 68
JRG-Developer Avatar answered Feb 27 '23 01:02

JRG-Developer