xcode 架构 i386 Facebook SDK 的未定义符号

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/26773783/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 06:06:22  来源:igfitidea点击:

Undefined symbols for architecture i386 Facebook SDK

iosobjective-cxcodefacebook

提问by Abel

I'm creating a new tabbed iOS application in xCode 5.1.1. I'm had done research but none of the solutions work to me. So I ended up with migration from xCode 6.1 to xCode 5.1.1. But the problem still occur which I have no idea now. Perhaps the settings in architecture i386 need to be changed. But I have no idea how.

我正在 xCode 5.1.1 中创建一个新的标签式 iOS 应用程序。我已经完成了研究,但没有一个解决方案对我有用。所以我最终从 xCode 6.1 迁移到了 xCode 5.1.1。但问题仍然出现,我现在不知道。也许架构 i386 中的设置需要更改。但我不知道如何。

Error:

错误:

Undefined symbols for architecture i386:
"_OBJC_CLASS_$_ASIdentifierManager", referenced from: objc-class-ref in FBAudienceNetwork(FBAdUtility.o) "_OBJC_CLASS_$_CMMotionManager", referenced from: objc-class-ref in FBAudienceNetwork(FBAdAnalogInfo.o) ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

架构 i386 的未定义符号:
“_OBJC_CLASS_$_ASIdentifierManager”,引用自:FBAudienceNetwork(FBAdUtility.o) 中的 objc-class-ref “_OBJC_CLASS_$_CMMotionManager”,引用自:FBAudienceNetwork(FBAdAnalogInfo.o) 中的 objc-class-ref找不到架构 i386 clang 的符号:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)

Build Settings

构建设置

Standard architectures(armv7, armv7s, arm64) - $(ARCHS_STANDARD)

Build Active Architecture Only : YES / NO

标准架构(armv7, armv7s, arm64) - $(ARCHS_STANDARD)

仅构建活动架构:是/否



Update:

更新:

After adding CoreMotion and AdSupport frameworks, errors had been reduced. But left one more error which state:

添加 CoreMotion 和 AdSupport 框架后,错误减少了。但又留下了一个错误,其中指出:

missing required architecture x86_64 in file {DIRECTORY}/FacebookSDK/Bolts.framework/Bolts (2 slices)
duplicate symbol _OBJC_IVAR_$_AppDelegate._window in

Current Framework:

当前框架:

  • CoreMotion
  • AdSupport
  • CoreGraphics
  • FacebookSDK
  • UIKit
  • FBAudienceNetwork
  • Foundation
  • Bolts
  • 核心运动
  • 广告支持
  • 核心图形
  • 脸书SDK
  • 用户界面工具包
  • FB观众网络
  • 基础
  • 螺栓

回答by l0gg3r

You need to link

你需要链接

AdSupport.framework  
CoreMotion.framework  

回答by gusC

Did you remove Sample folder after dragging in the FacebookSDK into Frameworks group of your Xcode project? I had the same issue, and it was because Xcode tried to compile all the samples too. Removed Samples folder - everything works as a charm - no need to add AdSupport or any other framework.

将 FacebookSDK 拖入 Xcode 项目的 Frameworks 组后,您是否删除了 Sample 文件夹?我遇到了同样的问题,这是因为 Xcode 也尝试编译所有示例。删除了 Samples 文件夹 - 一切都像魅力一样 - 无需添加 AdSupport 或任何其他框架。

回答by Abel

You probably didn't add AdSupport.framework.

你可能没有添加AdSupport.framework.

set property for architecture as below image..

为架构设置属性如下图..

enter image description here

在此处输入图片说明

enter image description here

在此处输入图片说明

回答by thoughtbreaker

Delete Sample Folder. Clean and Build. Will work like a charm.

删除示例文件夹。清洁和建造。会像魅力一样工作。