Xcode 7 build failed: ld: library not found for -lGoogleAnalyticsServices

SDW picture SDW · Oct 19, 2015 · Viewed 27k times · Source

Every time when I open my app with Xcode I get this error:

ld: library not found for -lGoogleAnalyticsServices
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Then I need to unmark the target on the libGoogleAnalyticsServices.a file and mark it on again. After the uncheck/check of the target the app runs normally...

enter image description here

I get 2 other warning when this happens:

ld: warning: directory not found for option '-L/Users/vision/Documents/Apps/Mijn Cijfers/Mijn'
ld: warning: directory not found for option '-LCijfers'

Now this looks like Xcode can't read spaces and looks for a new directory called Cijfers. My app is called: Mijn Cijfers, but I never had this problem before with spaces in my project name.

Every time when I check/uncheck the target of libGoogleAnalyticsServices.a the Library Search Path is adding new rows:

enter image description here

I think both cases has to do something with the warnings and errors that I get. It's really annoying to remove the Library Search Paths and check/uncheck the target to let my app run normally. -.-

Does anyone know a solution to solve this odd bug?

Answer

Meenakshi picture Meenakshi · Oct 19, 2015

You need to delete all these path except the "$inherited" and then add Google Analytics library path (Drag the folder where you saved the library).

If you follow this then you don't need to recheck/uncheck the library path.

library search Path screen shot