3

I'm trying to add Apptentive to an IOS app. There are quite a few external libraries already being used such as Admob and Google analytics.

I've followed this guide to the letter but I just can't make it blend. Behold the nasty failure message below:

Undefined symbols for architecture armv7:
  "_kCTUnderlineStyleAttributeName", referenced from:
      -[ATTTTAttributedLabel commonInit] in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_CTFontCopyName", referenced from:
      ___NSAttributedStringByScalingFontSize_block_invoke in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_CTFontGetSize", referenced from:
      ___NSAttributedStringByScalingFontSize_block_invoke in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_kCTForegroundColorFromContextAttributeName", referenced from:
      _NSAttributedStringBySettingColorFromContext in libApptentiveConnect.a(TTTAttributedLabel.o)
      ___NSAttributedStringBySettingColorFromContext_block_invoke in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_CTFramesetterSuggestFrameSizeWithConstraints", referenced from:
      -[ATTTTAttributedLabel textRectForBounds:limitedToNumberOfLines:] in libApptentiveConnect.a(TTTAttributedLabel.o)
      -[ATTTTAttributedLabel sizeThatFits:] in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_CTFontGetUnderlineThickness", referenced from:
      -[ATTTTAttributedLabel drawStrike:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_CTLineGetGlyphRuns", referenced from:
      -[ATTTTAttributedLabel drawBackground:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
      -[ATTTTAttributedLabel drawStrike:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_CTFrameGetLineOrigins", referenced from:
      -[ATTTTAttributedLabel characterIndexAtPoint:] in libApptentiveConnect.a(TTTAttributedLabel.o)
      -[ATTTTAttributedLabel drawFramesetter:attributedString:textRange:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
      -[ATTTTAttributedLabel drawBackground:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
      -[ATTTTAttributedLabel drawStrike:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_CTRunGetTypographicBounds", referenced from:
      -[ATTTTAttributedLabel drawBackground:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
      -[ATTTTAttributedLabel drawStrike:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_CTRunGetStringRange", referenced from:
      -[ATTTTAttributedLabel drawBackground:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
      -[ATTTTAttributedLabel drawStrike:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_CTLineGetOffsetForStringIndex", referenced from:
      -[ATTTTAttributedLabel drawBackground:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
      -[ATTTTAttributedLabel drawStrike:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_CTLineCreateTruncatedLine", referenced from:
      -[ATTTTAttributedLabel drawFramesetter:attributedString:textRange:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_CTLineDraw", referenced from:
      -[ATTTTAttributedLabel drawFramesetter:attributedString:textRange:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_kCAGravityResizeAspect", referenced from:
      -[ATFileMessageCell layoutSubviews] in libApptentiveConnect.a(ATFileMessageCell.o)
      -[ATFileMessageCell setCurrentImage:] in libApptentiveConnect.a(ATFileMessageCell.o)
  "_CTFramesetterCreateFrame", referenced from:
      -[ATTTTAttributedLabel characterIndexAtPoint:] in libApptentiveConnect.a(TTTAttributedLabel.o)
      -[ATTTTAttributedLabel drawFramesetter:attributedString:textRange:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
      -[ATTTTAttributedLabel sizeThatFits:] in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_kCTFontAttributeName", referenced from:
      ___65-[ATMessageCenterViewController tableView:cellForRowAtIndexPath:]_block_invoke in libApptentiveConnect.a(ATMessageCenterViewController.o)
      ___65-[ATMessageCenterViewController tableView:cellForRowAtIndexPath:]_block_invoke666 in libApptentiveConnect.a(ATMessageCenterViewController.o)
      ___65-[ATMessageCenterViewController tableView:cellForRowAtIndexPath:]_block_invoke685 in libApptentiveConnect.a(ATMessageCenterViewController.o)
      _NSAttributedStringAttributesFromLabel in libApptentiveConnect.a(TTTAttributedLabel.o)
      _NSAttributedStringByScalingFontSize in libApptentiveConnect.a(TTTAttributedLabel.o)
      ___NSAttributedStringByScalingFontSize_block_invoke in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_CTFrameGetLines", referenced from:
      -[ATTTTAttributedLabel characterIndexAtPoint:] in libApptentiveConnect.a(TTTAttributedLabel.o)
      -[ATTTTAttributedLabel drawFramesetter:attributedString:textRange:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
      -[ATTTTAttributedLabel drawBackground:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
      -[ATTTTAttributedLabel drawStrike:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
      -[ATTTTAttributedLabel sizeThatFits:] in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_kCTFontPostScriptNameKey", referenced from:
      ___NSAttributedStringByScalingFontSize_block_invoke in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_CTFramesetterCreateWithAttributedString", referenced from:
      -[ATTTTAttributedLabel framesetter] in libApptentiveConnect.a(TTTAttributedLabel.o)
      -[ATTTTAttributedLabel drawTextInRect:] in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_CTLineGetTypographicBounds", referenced from:
      -[ATTTTAttributedLabel characterIndexAtPoint:] in libApptentiveConnect.a(TTTAttributedLabel.o)
      -[ATTTTAttributedLabel drawBackground:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
      -[ATTTTAttributedLabel drawStrike:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_CTLineGetStringIndexForPosition", referenced from:
      -[ATTTTAttributedLabel characterIndexAtPoint:] in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_CTLineGetStringRange", referenced from:
      -[ATTTTAttributedLabel drawFramesetter:attributedString:textRange:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
      -[ATTTTAttributedLabel sizeThatFits:] in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_kCTSuperscriptAttributeName", referenced from:
      -[ATTTTAttributedLabel drawStrike:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_kCTParagraphStyleAttributeName", referenced from:
      -[ATTTTAttributedLabel commonInit] in libApptentiveConnect.a(TTTAttributedLabel.o)
      _NSAttributedStringAttributesFromLabel in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_kCTForegroundColorAttributeName", referenced from:
      ___65-[ATMessageCenterViewController tableView:cellForRowAtIndexPath:]_block_invoke666 in libApptentiveConnect.a(ATMessageCenterViewController.o)
      -[ATTTTAttributedLabel commonInit] in libApptentiveConnect.a(TTTAttributedLabel.o)
      -[ATTTTAttributedLabel drawStrike:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
      _NSAttributedStringAttributesFromLabel in libApptentiveConnect.a(TTTAttributedLabel.o)
      -[ATTTTAttributedLabel drawTextInRect:] in libApptentiveConnect.a(TTTAttributedLabel.o)
      ___NSAttributedStringBySettingColorFromContext_block_invoke in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_CTLineGetPenOffsetForFlush", referenced from:
      -[ATTTTAttributedLabel drawFramesetter:attributedString:textRange:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_CTRunGetAttributes", referenced from:
      -[ATTTTAttributedLabel drawBackground:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
      -[ATTTTAttributedLabel drawStrike:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_CTParagraphStyleCreate", referenced from:
      -[ATTTTAttributedLabel commonInit] in libApptentiveConnect.a(TTTAttributedLabel.o)
      _NSAttributedStringAttributesFromLabel in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_CTFontCreateWithName", referenced from:
      ___65-[ATMessageCenterViewController tableView:cellForRowAtIndexPath:]_block_invoke in libApptentiveConnect.a(ATMessageCenterViewController.o)
      ___65-[ATMessageCenterViewController tableView:cellForRowAtIndexPath:]_block_invoke666 in libApptentiveConnect.a(ATMessageCenterViewController.o)
      ___65-[ATMessageCenterViewController tableView:cellForRowAtIndexPath:]_block_invoke685 in libApptentiveConnect.a(ATMessageCenterViewController.o)
      -[ATTTTAttributedLabel drawStrike:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
      _NSAttributedStringAttributesFromLabel in libApptentiveConnect.a(TTTAttributedLabel.o)
      ___NSAttributedStringByScalingFontSize_block_invoke in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_CTLineCreateWithAttributedString", referenced from:
      -[ATTTTAttributedLabel drawFramesetter:attributedString:textRange:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_OBJC_CLASS_$_CTTelephonyNetworkInfo", referenced from:
      objc-class-ref in libApptentiveConnect.a(ATLegacyRecord.o)
      objc-class-ref in libApptentiveConnect.a(ATDeviceInfo.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

What's going wrong and how do I fix it? It's been 2 days now and I'm going mad.

eta: if I follow exactly the same steps in a more lightweight project it builds just fine, so I'm guessing there's some kind of conflict. I just don't know how to go about resolving it.

4

1 回答 1

12

您还没有向项目添加一些框架。(大概CoreTextCoreTelephony

有关如何执行此操作,请参阅如何在 Xcode 4 中“添加现有框架”?

引自 Apptentive 指南:

为了使用 ApptentiveConnect,您的项目必须链接到以下框架:

CoreData
CoreText
CoreGraphics
CoreTelephony
Foundation
QuartzCore
StoreKit
SystemConfiguration
UIKit

于 2013-08-23T11:58:47.830 回答