iosobjective-cgoogle-analyticscocoapodsxcode-workspace

Apple Mach-O Linker Error while running the Google Analytics project using Pods


I am a beginner level programmer and stuck in a problem with Google Analytics libraries while using cocoa pods.

I have installed the cocoa pods properly, installed the pod file with the dependencies inside it. Even I can see the Generated files inside the finder in a separate folder "Pods" also GoogleAnalytics1.xcworkspace but FYI

  1. GoogleAnalytics1 is the name of my project.

  2. GoogleAnalytics1.xcworkspace(created during the pod file installation) and GoogleAnalytics.xcodeproject are in the same folder named "GoogleAnalytics1".

Any kind of help will be appreciated.Thanks in advance.

Ld /Users/rajesh/Library/Developer/Xcode/DerivedData/GoogleAnalytics1-gklncgocdpccldgqeibewkakesqh/Build/Products/Debug-iphonesimulator/GoogleAnalytics1.app/GoogleAnalytics1 normal i386
cd /Users/rajesh/Documents/Mangesh/BBI/Project/US/NewTableView16/GoogleAnalytics1
export IPHONEOS_DEPLOYMENT_TARGET=8.1
export PATH="/Applications/Xcode 2.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode 2.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode\ 2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode\ 2.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk -     
L/Users/rajesh/Library/Developer/Xcode/DerivedData/GoogleAnalytics1-    gklncgocdpccldgqeibewkakesqh/Build/Products/Debug-iphonesimulator -    L/Users/rajesh/Documents/Mangesh/BBI/Project/US/NewTableView16/GoogleAnalytics1/Pods/Google/Libraries -
L/Users/rajesh/Documents/Mangesh/BBI/Project/US/NewTableView16/GoogleAnalytics1/Pods/GoogleAnalytics/Libraries -
L/Users/rajesh/Documents/Mangesh/BBI/Project/US/NewTableView16/GoogleAnalytics1/Pods/GoogleNetworkingUtilities/Libraries -
L/Users/rajesh/Documents/Mangesh/BBI/Project/US/NewTableView16/GoogleAnalytics1/Pods/GoogleSymbolUtilities/Libraries -
L/Users/rajesh/Documents/Mangesh/BBI/Project/US/NewTableView16/GoogleAnalytics1/Pods/GoogleUtilities/Libraries -
F/Users/rajesh/Library/Developer/Xcode/DerivedData/GoogleAnalytics1-gklncgocdpccldgqeibewkakesqh/Build/Products/Debug-iphonesimulator -filelist   /Users/rajesh/Library/Developer/Xcode/DerivedData/GoogleAnalytics1-  
gklncgocdpccldgqeibewkakesqh/Build/Intermediates/GoogleAnalytics1.build/Debug-iphonesimulator/GoogleAnalytics1.build/Objects-normal/i386/GoogleAnalytics1.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -objc_abi_version -Xlinker 2 -ObjC -lGGLAnalytics -lGGLCore -lGSDK_Overload -lGTMSessionFetcher_core -lGTMSessionFetcher_full -lGTMStackTrace -lGTM_AddressBook -lGTM_DebugUtils -lGTM_GTMURLBuilder -lGTM_KVO -lGTM_NSDictionary+URLArguments -lGTM_NSScannerJSON -lGTM_NSStringHTML -lGTM_NSStringXML -lGTM_Regex -lGTM_RoundedRectPath -lGTM_StringEncoding -lGTM_SystemVersion -lGTM_UIFont+LineHeight -lGTM_core -lGTM_iPhone -lGoogleAnalytics -lsqlite3 -lz -framework AddressBook -framework CoreData -framework SystemConfiguration -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=8.1 -lPods-GoogleAnalytics1 -Xlinker -dependency_info -Xlinker /Users/rajesh/Library/Developer/Xcode/DerivedData/GoogleAnalytics1-gklncgocdpccldgqeibewkakesqh/Build/Intermediates/GoogleAnalytics1.build/Debug-iphonesimulator/GoogleAnalytics1.build/Objects-normal/i386/GoogleAnalytics1_dependency_info.dat -o /Users/rajesh/Library/Developer/Xcode/DerivedData/GoogleAnalytics1-gklncgocdpccldgqeibewkakesqh/Build/Products/Debug-iphonesimulator/GoogleAnalytics1.app/GoogleAnalytics1

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

Solution

  • As mentioned in comments, you need to open the .xcworkspace file to open the project once you have pods working on it.

    Another issue that I have come across though - XCode 7 (currently still in Beta but will be out normally soon) also produces these problems with cocoapods. So if you're trying to use Swift 2 right now, cocoapods is not working in projects, and you get similar errors to the ones you are seeing. I have had to uninstall cocoapods on current Swift 2 projects because of this issue, and Im currently looking at other options - Carthage looking like the best option so far. https://github.com/Carthage/Carthage