9

Today I updated my Xcode to Xcode 5.1, and now every time I try to compile my code and test it on the simulator I got several errors about architecture 86_64 and Google Analytics Services Library. This is what I got:

Ld /Users/prelite/Library/Developer/Xcode/DerivedData/iSanMarino-hkgasucjnyttlxcbtgqjjpcxutzx/Build/Products/Debug-iphonesimulator/iSanMarino.app/iSanMarino normal x86_64
    cd "/Users/prelite/Desktop/iSanMarino 3.0"
    export IPHONEOS_DEPLOYMENT_TARGET=7.0
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk -L/Users/prelite/Library/Developer/Xcode/DerivedData/iSanMarino-hkgasucjnyttlxcbtgqjjpcxutzx/Build/Products/Debug-iphonesimulator -L/Users/prelite/Desktop/iSanMarino\ 3.0/iSanMarino/Analytics -F/Users/prelite/Library/Developer/Xcode/DerivedData/iSanMarino-hkgasucjnyttlxcbtgqjjpcxutzx/Build/Products/Debug-iphonesimulator -filelist /Users/prelite/Library/Developer/Xcode/DerivedData/iSanMarino-hkgasucjnyttlxcbtgqjjpcxutzx/Build/Intermediates/iSanMarino.build/Debug-iphonesimulator/iSanMarino.build/Objects-normal/x86_64/iSanMarino.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=7.0 -lGoogleAnalyticsServices -framework AudioToolbox -framework CoreData -framework QuartzCore -framework SystemConfiguration -lsqlite3 -framework EventKitUI -framework EventKit -framework CoreLocation -framework MessageUI -framework MapKit -framework UIKit -framework Foundation -framework CoreGraphics -Xlinker -dependency_info -Xlinker /Users/prelite/Library/Developer/Xcode/DerivedData/iSanMarino-hkgasucjnyttlxcbtgqjjpcxutzx/Build/Intermediates/iSanMarino.build/Debug-iphonesimulator/iSanMarino.build/Objects-normal/x86_64/iSanMarino_dependency_info.dat -o /Users/prelite/Library/Developer/Xcode/DerivedData/iSanMarino-hkgasucjnyttlxcbtgqjjpcxutzx/Build/Products/Debug-iphonesimulator/iSanMarino.app/iSanMarino

Undefined symbols for architecture x86_64:
  "_deflate", referenced from:
      +[GAICompressionUtil gai_dataByCompressingBytes:length:compressionLevel:mode:] in libGoogleAnalyticsServices.a(GAICompressionUtil.o)
  "_deflateEnd", referenced from:
      +[GAICompressionUtil gai_dataByCompressingBytes:length:compressionLevel:mode:] in libGoogleAnalyticsServices.a(GAICompressionUtil.o)
  "_deflateInit2_", referenced from:
      +[GAICompressionUtil gai_dataByCompressingBytes:length:compressionLevel:mode:] in libGoogleAnalyticsServices.a(GAICompressionUtil.o)
  "_inflate", referenced from:
      +[GAICompressionUtil gai_dataByInflatingBytes:length:isRawData:] in libGoogleAnalyticsServices.a(GAICompressionUtil.o)
  "_inflateEnd", referenced from:
      +[GAICompressionUtil gai_dataByInflatingBytes:length:isRawData:] in libGoogleAnalyticsServices.a(GAICompressionUtil.o)
  "_inflateInit2_", referenced from:
      +[GAICompressionUtil gai_dataByInflatingBytes:length:isRawData:] in libGoogleAnalyticsServices.a(GAICompressionUtil.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I updated also the Google Analytics Library and tried to remove and readd it but nothing.

prelite
  • 1,073
  • 2
  • 9
  • 20
  • I downloaded and a new version 3.03c, did a clean and build and everything went back to normal. I'm guessing your old library (like mine) didn't support these architectures. Here's the URL https://developers.google.com/analytics/devguides/collection/ios/resources – DBD Mar 13 '14 at 19:51
  • I already tried that, I removed all the .m and .h and framework files...then readded again all the files of the 3.03c performed a clean but nothing changed...maybe the problem is in "Build Settings"...What did you set up on "Search Path" and "Valid Architectures" ? – prelite Mar 13 '14 at 20:11
  • Changing the target to ïOSDevice fixed issue for me. For simulators its not working. Strange. – Nirav May 22 '14 at 09:27

2 Answers2

42

Solution: I just added libz.dylib framework and everything worked fine!

prelite
  • 1,073
  • 2
  • 9
  • 20
  • 1
    Thanks. Saved me a lot of time. it is really annoying that the V3 is not backward compatible. And the new methods require more coding to do the same thing than the previous version. Please accept your own answer as the right answer. – Ray Mar 14 '14 at 14:31
-1

You'll get this error if you load .xcodeproj file and try to build it. Open up the .xcworkspace that's included instead and you'll be fine.

Either select "Open other" and select it from your project directory, or from a command prompt in your project directory:

open <YourProjectName>.xcworkspace

No other dependencies should be needed.

Jeremy Morgan
  • 3,314
  • 23
  • 23