适用于Unity iOS Mach-O链接器的FacebookSDK错误 - 未定义符号_iosLogin, [英] FacebookSDK for Unity iOS Mach-O linker error - undefined symbols _iosLogin,

查看:153
本文介绍了适用于Unity iOS Mach-O链接器的FacebookSDK错误 - 未定义符号_iosLogin,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我根据这里的教程 https:将FacebookSDK添加到我的Unity项目中//developers.facebook.com/docs/unity/getting-started/canvas/

这意味着我已经下载了SDK .unitypackage,将其导入Unity项目并在配置设置检查器中设置应用程序名称和ID。

It means that I've downloaded the SDK .unitypackage, imported it into Unity project and set application name and ID in configuration settings inspector.

当我尝试为设备构建时,Xcode构建依赖于以下Mach-O链接器错误:

When I try to build for device, Xcode build hangs on following Mach-O linker error:

Undefined symbols for architecture armv7:
  "_iosLogin", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_iosLogout", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_iosInit", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_iosSetShareDialogMode", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_iosFeedRequest", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_iosAppRequest", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_iosFBSettingsPublishInstall", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_iosFBAppEventsSetLimitEventUsage", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_iosGetDeepLink", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_iosFBAppEventsLogPurchase", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_iosFBAppEventsLogEvent", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

看起来Unity,Xcode或我忘了包含一些库,搜索路径或源文件som ewhere。你能帮我找出发生了什么问题吗?你知道这个符号应该在哪个文件中或者如何设置链接器吗?

It looks like Unity, Xcode or me forgot to include some library, search path or source file somewhere. Can you help me to find out what happened wrong? Do you know in which file this symbols should be or how to setup linker?

Unity 4.3.0f4 (also tried 4.2.?)
Facebook SDK 4.3.4 (also tried 4.3.3)
Xcode 5.0.2, deployment target 4.0 (also tried 6.1)


推荐答案

这些符号从FacebookSDK.a导出,应该通过/ Assets中的[PostProcessBuild]步骤将其包含到您的Xcode项目中/Facebook/Editor/FacebookPostprocess.cs。该文件实际上会旋转您项目中的所有文件,这些文件在其文件名中以.projmods结尾,并将它们作为转换应用于您的xcode项目。遇到这种问题时,我发现有两件事出了问题:

Those symbols are exported from FacebookSDK.a, which should be getting included into your Xcode project by the [PostProcessBuild] step in /Assets/Facebook/Editor/FacebookPostprocess.cs. That file actually spins through all of the files in your project that end with ".projmods" in their filename and applies them as transformations to your xcode project. I've seen 2 things go wrong here when having this kind of problem:


  1. 我删除了FacebookPostprocess.cs或其中一些.projmods我的项目中的文件意外。检查两者是否存在。在这种情况下,特定的projmods文件应位于/ Assets / Facebook / Editor / iOS。

  2. 您有自己的[PostProcessBuild]步骤可以破坏Facebook的更改。您可以通过将可选的order参数应用于PostProcessBuild属性来解决此问题。

您还可以在Xcode中检查FacebookSDK.a确实,在项目的/ Libraries组中,并且在Build Phases下,它被包含为要链接的二进制文件。

You can also check in Xcode that FacebookSDK.a is, indeed, in the /Libraries group of the project and that under "Build Phases" it is included as a binary to link with.

另外仔细查看日志构建时从Unity输出。有时projmods后处理器会抱怨找不到的文件等等。

Also look carefully at the log output from Unity when you build. Sometimes the projmods postprocessor will complain about files not found, etc.

这篇关于适用于Unity iOS Mach-O链接器的FacebookSDK错误 - 未定义符号_iosLogin,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆