3
votes

All my targets use the same libraries, so I use link_with to make my podfile neat. But to my surprise the project compiled failed. Xcode complains it can't find some files in pod, e.g.

diff: /../Podfile.lock: No such file or directory diff: /Manifest.lock: No such file or directory error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.

And

'DDLog.h' file not found

I run pod install again and clean xcode again and again. But no luck. I was not able to figure out why. From what I can see cocopods only changed shellScript for each target to one single Pods-resources.sh, which is what link_with is supposed to do, right?

shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CloudPhone/Pods-"my target"-resources.sh\"\n";
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n";

Is this a cocopods's bug? I am using latest one 0.37 and now I went back to specify each target individually.

Update:

CocoaPods 1.0 has removed link_with in favour of abstract_target

3

3 Answers

7
votes

I think this is a pods bug. The pods doesnot update the script location, when a project specify target specific configuration initially and later tries to combine it.

To fix, go to Build phases->Embedd pod framework-> update the script file location to reflect the universal pod folder (like /Pods/Pods-frameworks.sh"). [You can navigate in finder to find exactly where the sh is present]. Remove any other script which doesn't reflect in physical folder. Now the project should compile.

3
votes

Quick solution: remove Embed Pod Frameworks and run pod install again

enter image description here

1
votes

Came across the same error. Just want to add to Sukitha's Answer.

Go to build phase -> Embed pod framework -> $SRCROOT

Be sure to check that this SRSCROOT file block correctly leads up to the frameworks.h file.

You will need to edit in order to correct issue.

Cheers