ios - 通过 Cocoapods 集成 Apptentive iOS SDK 时出现 undefined symbol 错误

标签 ios xcode frameworks cocoapods apptentive

通过 Cocoapods 集成 Apptentive iOS SDK 时,出现以下错误:

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_ATConnect", referenced from:
      objc-class-ref in AppDelegate.o
  "_OBJC_CLASS_$_ATAppRatingFlow", referenced from:
      objc-class-ref in AppDelegate.o
  "_OBJC_CLASS_$_ATSurveys", referenced from:
      objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture i386
clang: 

error: linker command failed with exit code 1 (use -v to see invocation)

应该如何修复这些错误?

最佳答案

我们发现,将 Apptentive cocoa pod 添加到现有 Xcode 项目中可能不包含我们需要的一些框架。

检查您的链接器标志:

Target > Build Settings > Other Linker Flags

您应该看到 -lApptentiveConnect列为链接器标志:
... -ObjC -lApptentiveConnect ...

您还应该看到我们列出的所需框架:
  • 加速
  • 核心数据
  • 芯文
  • 核心图形
  • 核心电话
  • 基金会
  • quartz 芯
  • StoreKit
  • 系统配置
  • UIKit
    -ObjC -lApptentiveConnect -framework Accelerate -framework CoreData -framework CoreGraphics -framework CoreText -framework Foundation -framework QuartzCore -framework SystemConfiguration -framework UIKit -framework CoreTelephony -framework StoreKit 
    
  • 关于ios - 通过 Cocoapods 集成 Apptentive iOS SDK 时出现 undefined symbol 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20864172/

    相关文章:

    ios - 在裁剪区域下显示 View /点/smt

    objective-c - 带有图像的 ios 标签栏自定义

    objective-c - 设置 UIView 子类的背景颜色不起作用

    objective-c - 使用 XCode 3 对 iPhone 静态库进行单元测试

    ios - 编译 Swift 源文件卡在 xcode 7.3.1

    python - 没有名为 objc 的模块

    testing - 在 telerik test studio 中单击客户文本 block 的代码

    ios - 使用 Parse 保存数据,现有项目

    c# - 使用程序安装安装 .NET Framework

    swift - 将 Xcode MVC 项目导出到 .framework 文件