1

I am trying to migrate our existing CocoaPod configuration from 0.39.0 to 1.0.1.

Our existing Podfile looks like:

platform :ios, '9.0'
use_frameworks!

target 'Tools' do
  pod 'zipzap', '~> 8.0.4'
  pod 'Argo', '~> 2.2.0'
  pod 'Curry', :git => 'https://github.com/thoughtbot/Curry.git', :commit => 'eeb459fac309833288e61e134a4e8fad649e99b0'
end

target 'ToolsTests' do
end

This compiled and the tests ran just fine previously. After following the migration guide. I restructured the Podfile like so:

platform :ios, '9.0'

target 'Tools' do
  use_frameworks!

  pod 'zipzap', '~> 8.0.4'
  pod 'Argo', '~> 2.2.0'
  pod 'Curry', :git => 'https://github.com/thoughtbot/Curry.git', :commit => 'eeb459fac309833288e61e134a4e8fad649e99b0'

  target 'ToolsTests' do
    inherit! :search_paths
  end
end

This compiles and links just fine. Unfortunately when the tests run they crash with:

2016-06-07 12:04:06.265 xctest[56474:789900] The bundle “ToolsTests” couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle.
2016-06-07 12:04:06.299 xctest[56474:789900] (dlopen_preflight($HOME/Library/Developer/Xcode/DerivedData/Tools-dbmncsubtoarlhhcrpchrswefprz/Build/Intermediates/CodeCoverage/Products/Debug-iphonesimulator/ToolsTests.xctest/ToolsTests): Library not loaded: @rpath/Argo.framework/Argo
  Referenced from: $HOME/Library/Developer/Xcode/DerivedData/Tools-dbmncsubtoarlhhcrpchrswefprz/Build/Intermediates/CodeCoverage/Products/Debug-iphonesimulator/ToolsTests.xctest/ToolsTests
  Reason: image not found)
Program ended with exit code: 82

In the migration guide it says:

A large fraction of the bug reports we receive is due to ambiguity in the Podfile. It gave a lot of freedom to create all kinds of CocoaPods setups that would work by luck of implementation details, or work but are significantly more complex than they needed to be.

Is this one of those cases that used to "work by luck of implementation details"? If not what is the correct Podfile syntax?

I should note if I duplicate the pod defs in the ToolsTests everything works just fine. Though this feels wrong.

Ryan
  • 6,432
  • 7
  • 40
  • 54

1 Answers1

3

Similar question: Cocoapods testing linker error

Seems to be a common problem people are facing when upgrading. Your new Podfile looks right to me.

If you haven't already, I would try:

cleaning the build folder (in Xcode -> Option+Shift+Command+K)

clearing the derived data folder (rm -rf ~/Library/Developer/Xcode/DerivedData)

clearing your CocoaPods cache (rm -rf ~/Library/Caches/CocoaPods)

and run pod install again

EDIT: The question I mentioned above has an answer now: https://stackoverflow.com/a/37705768/3067051

Community
  • 1
  • 1
Ashley
  • 156
  • 5