Nothing that was written here helped me - but it did set me on the right path. What I ended up doing was the following:
Analyze the error message.
It says Library not found: -lPods-..
. So it cannot find that particular library. How to resolve it? Well, make sure that this library is in the search path. So where is this library located?
Search where the library is located.
I typed find . | grep -e 'Pods-.*\.a'
in a terminal in my ~/Library/Developer/Xcode/DerivedData
folder. I found out my libPods-...
library is located in a bunch of places, for example ~/Library/Developer/Xcode/DerivedData/[generated-name]/Build/Products/Release-iphonesimulator/libPods-[name].a
Add one of these folders to the library search path
If we add one of these folders to the library search path, then the problem will disappear. However, all the paths have a [generated-name]
folder somewhere, in my case [Project]-guyraaahpczkqmhghlwgsdsqyxxs
.
So how do we add that folder to the search path responsibly? By using a build time variable! We can get a list of which variables exist by looking at this answer. It turns out one of the variables that's defined is called ${PODS_CONFIGURATION_BUILD_DIR}
, and in that exact folder my libPods-[Product].a
is located!
Now add that folder to the library search path.
This is the easy part, and my actual answer to this question. Go to Build Settings -> Search paths -> Library search, make sure it is collapsed, and double click on <Multiple Values>.
In the dialog that pops up, click on the little '+' sign in the bottom left. Now type "${PODS_CONFIGURATION_BUILD_DIR}"
, and leave the drop-down option at "non-recursive". Type <Enter>. Now drag this entry all the way back up so that it sits directly under $(inherited)
.
You're done. Rebuild your product!
My error had now disappeared. Upvote this answer, close the tab, and forget the problem ever existed