Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

xcode

ios

xcode7

I have been struggling to get my xcode project to build for the last couple hours. I keep getting the following error:

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

I have tried almost everything. I saw that the Google Developers website said to use pod 'Google/Analytics', even after trying almost everything I could find on StackOverflow and Google regarding the error, I have had absolutely no luck.

I upgraded to XCode 7 yesterday, everything seemed to work yesterday but today suddenly I started getting this error.

If someone has anything I can do about this error, please help!

Pointing me in the right direction to get it fixed would be awesome too!

Thanks in advance for your help.

like image 564
Aashay Avatar asked Sep 22 '15 16:09

Aashay


3 Answers

The linker flag has been renamed to:

-lGoogleAnalytics

but the Cocoapods settings have not been updated yet. Rename the entry in "Other Linker Flags" and your problem will be solved.

Also, the library (as of the moment I write is version 3.13.0) does not support Bitcode yet, thus please turn off Bitcode in Build Options > Enable Bitcode > Select "No". Clean & Rebuild afterwards.

like image 107
Raptor Avatar answered Nov 03 '22 19:11

Raptor


Same problem occurred in my project. What I did, I just updated all my pods and after that my app got compiled.

Run "pod update" command from terminal in your project directory where the pod file is located.

like image 42
Dharmesh Siddhpura Avatar answered Nov 03 '22 21:11

Dharmesh Siddhpura


  1. Please make sure you opened .xcworkspace not .xcodeproj.

  2. Go to Library Search Paths in Build settings and add

    1. $(PROJECT_DIR)/Pods/build/Debug-iphoneos
    2. $(inherited)
  3. pod install again.

    Update cocoapods to the newest version that supports 64 arch.

    sudo gem update cocoapods

    Delete all Valid Architectures and Re-Add the architectures that you just removed.

    Clean and run

like image 40
Dhanas Manian Avatar answered Nov 03 '22 19:11

Dhanas Manian