TL;DR: If a CocoaPods-injected project won’t build with some weird errors, check that the symlinks are correct. Explanation follows.
Here is the situation. A guy from the client’s side zipped the sources of the iOS project on windows to copy them onto a Mac to build the app for AppStore. But the following errors would stop the build:
1 2 3 4 5 6 7 8 9 10 11 12 13
The only very similar issue I found was this: http://stackoverflow.com/questions/12607203/unqualified-id-in-file-included-from-zxbinarizer-mm, but it had no proper solution.
So I got the zipped sources and used DiffMerge to compare the two directory hierarchies to figure out the difference. Here’s the catch: CocoaPods creates softlinks (a.k.a. symlinks) for the used headers (like
Pods/Headers/CocoaLumberjack/DDLog.h pointing to
Pods/CocoaLumberjack/Lumberjack/DDLog.h), and when the project was checked out on windows, it created the softlinks as regular text files with the path to the original file. Look:
1 2 3
That is, both files are 40 bytes long, but the wrong one is just a usual file with this text:
which obviously fails to compile with the errors you can see above. It hadn’t been so easy to figure out on my mac, because OS X properly displays the contents of the files beyond the softlink. Zipping the sources on OS X solved the issue.
Leave a comment ⬇ if you have something to say.