将库添加到IOS应用程序会导致可怕的构建失败

Wil*_*ins 3 linker-errors ios apptentive

我正在尝试将Apptentive添加到IOS应用程序中.已经有相当多的外部库被使用,例如Admob和Google分析.

我按照这个指南来写这封信,但我不能让它融合.看到下面讨厌的失败信息:

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)
Run Code Online (Sandbox Code Playgroud)

出了什么问题,我该如何解决?现在已经2天了,我疯了.

eta:如果我在一个更轻量级的项目中遵循完全相同的步骤,它构建得很好,所以我猜测存在某种冲突.我只是不知道如何解决它.

iHu*_*ter 12

您还没有为项目添加一些框架.(据推测,CoreTextCoreTelephony)

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

Apptentive指南引用:

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

CoreData
CoreText
CoreGraphics
CoreTelephony
基础
QuartzCore
StoreKit
SystemConfiguration
UIKit