Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 336
SDW Avatar asked Oct 19 '15 17:10

SDW


2 Answers

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

like image 107
Meenakshi Avatar answered Nov 07 '22 13:11

Meenakshi


If you have just created pod file by running $ pod init command in terminal,

  • then just close project and Open projectName.xcworkspace instead of projectName.xcodeproj

which will not throw error -lxyzLibray eg. -lJSONModel not found.

Now compile and debug again It will work.

like image 36
karan Avatar answered Nov 07 '22 13:11

karan