Xcode 5.1 ld: не найдена библиотека для -lGoogleAnalyticsServices

Сегодня я обновил свой Xcode до Xcode 5.1, и теперь каждый раз, когда я пытаюсь скомпилировать свой код и протестировать его на симуляторе, я получаю несколько ошибок об архитектуре 86_64 и библиотеке сервисов Google Analytics. Вот что я получил:

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)

Я также обновил библиотеку Google Analytics и попытался удалить и прочитать ее, но ничего.


person prelite    schedule 13.03.2014    source источник


Ответы (2)


Решение: я только что добавил libz.dylib framework, и все заработало!

person prelite    schedule 13.03.2014
comment
Спасибо. Сэкономил мне много времени. очень раздражает, что V3 не имеет обратной совместимости. И новые методы требуют больше кода, чтобы сделать то же самое, чем предыдущая версия. Пожалуйста, примите свой ответ как правильный ответ. - person Ray; 14.03.2014

Вы получите эту ошибку, если загрузите файл .xcodeproj и попытаетесь его собрать. Вместо этого откройте прилагаемый файл .xcworkspace, и все будет в порядке.

Либо выберите «Открыть другое», либо выберите его из каталога вашего проекта или из командной строки в каталоге вашего проекта:

open <YourProjectName>.xcworkspace

Никаких других зависимостей не требуется.

person Jeremy Morgan    schedule 07.05.2014