Parse和Facebook SDK“螺栓”框架错误

时间:2022-06-07 11:28:38

I have an app with both the Parse and Facebook frameworks installed. Parse was installed by dragging the files to the "Frameworks" folder of the project and selecting "copy if needed", while the Facebook SDK was installed by dragging and not selecting the copy option. Both appear under the Linked Binaries list. The problem appears to be that Bolts is included in both SDKs. I tried just using the Facebook one, producing the following Link-O errors:

我有一个安装了Parse和Facebook框架的应用程序。通过将文件拖到项目的“Frameworks”文件夹并选择“如果需要复制”来安装Parse,同时通过拖动而不选择复制选项来安装Facebook SDK。两者都显示在链接二进制列表下。问题似乎是两个SDK都包含了螺栓。我尝试使用Facebook,产生以下Link-O错误:

Undefined symbols for architecture x86_64:  "_BFTaskMultipleExceptionsException", referenced from:      ___53+[PFObject(Private) deleteAllAsync:withSessionToken:]_block_invoke214 in Parse(PFObject.o)      ___65+[PFObject(Private) _deepSaveAsync:withCurrentUser:sessionToken:]_block_invoke311 in Parse(PFObject.o)ld: symbol(s) not found for architecture x86_64clang: error: linker command failed with exit code 1 (use -v to see invocation)

I deleted the link to the Facebook one and tried dragging the Parse one, but the error persisted. I also got the warning that

我删除了Facebook的链接并尝试拖动Parse,但错误仍然存​​在。我也得到了警告

ld: warning: ignoring file /Users/milesper/Documents/FacebookSDK/Bolts.framework/Bolts, missing required architecture x86_64 in file /Users/milesper/Documents/FacebookSDK/Bolts.framework/Bolts (2 slices)

even though I had deleted the file from the Facebook SDK.

即使我从Facebook SDK中删除了该文件。

How should I clean up the project and link to the Parse version of Bolts? Is there something else i should be doing?

我该如何清理项目并链接到Parse版本的螺栓?还有别的我应该做的吗?

5 个解决方案

#1


Turns out the order in which you include/search the frameworks in your project matters.

结果是您在项目中包含/搜索框架的顺序。

Here is what I did to work with Parse 1.6.4 and FacebookSDK without CacoaPods

以下是我在没有CacoaPods的情况下使用Parse 1.6.4和FacebookSDK所做的工作

  1. Use the latest version of Bolts. (1.1.4)
  2. 使用最新版本的螺栓。 (1.1.4)

  3. Your include paths should be ordered to find Bolt first, then FacebookSDK, then Parse
  4. 您的包含路径应​​先订购,先找到Bolt,然后再找到FacebookSDK,再找Parse

Parse和Facebook SDK“螺栓”框架错误

#2


Well I found it. The problem was that old files (which were now deleted) were being referenced in the "Library Search Paths Flag". Thanks to this post for giving me the idea. All I had to do was delete the old paths and it now works again.

好吧,我找到了。问题是旧文件(现已删除)在“图书馆搜索路径标记”中被引用。感谢这篇帖子给了我这个想法。我所要做的就是删除旧路径,它现在又可以工作了。

EDIT: It appears that for some situations the order of the search paths matters as well (see below).

编辑:似乎在某些情况下搜索路径的顺序也很重要(见下文)。

#3


That worked for me Temporary workaround for Parse 1.6.4 and Facebook SDK 3.23

这对我有用Parse 1.6.4和Facebook SDK 3.23的临时解决方法

Add to your AppDelegate.m or another class following constant after imports and before implementation section: NSString *const BFTaskMultipleExceptionsException = @"BFMultipleExceptionsException";

在导入之后和实现之前添加到AppDelegate.m或其他类后面的常量部分:NSString * const BFTaskMultipleExceptionsException = @“BFMultipleExceptionsException”;

The explanation of the bug https://*.com/a/29136507/1345244

错误的解释https://*.com/a/29136507/1345244

One hack I found for working around missing symbols, was just redefining the missing symbol again in my code.

我找到了解决缺失符号的一个黑客,只是在我的代码中重新定义了丢失的符号。

The BFTaskMultipleExceptionsException string is defined here like this:

这里定义了BFTaskMultipleExceptionsException字符串,如下所示:

NSString *const BFTaskMultipleExceptionsException = @"BFMultipleExceptionsException"; So maybe just try putting that one line into your code?

NSString * const BFTaskMultipleExceptionsException = @“BFMultipleExceptionsException”;那么也许只是尝试将这一行放入您的代码中?

From the history on github, it looks like this was just added to Bolts about 19 days ago. Version 1.1.4 of Bolts was released 14 days ago (1.1.3 was from October last year). So it probably is caused by the version mismatch of Bolts that you noticed.

从github的历史来看,它似乎刚刚在19天前添加到Bolts。螺栓版本1.1.4在14天前发布(1.1.3从去年10月开始)。所以它可能是由你注意到的螺栓版本不匹配引起的。

Another option might be to get an older version of Parse from before Bolts 1.1.4 was released.

另一种选择可能是在Bolts 1.1.4发布之前获得较旧版本的Parse。

Presumably this will be fixed once a new Facebook SDK is available with Bolts 1.1.4.

据推测,一旦新的Facebook SDK可用于螺栓1.1.4,这将得到修复。

#4


same problem here.

同样的问题在这里

I had both frameworks included with no problem, until I added SponsorPay SDK which needs to add the -ObjC in "Other Linker Flags" on target "Build Settings".

我有两个框架没有问题,直到我添加了SponsorPay SDK,需要在目标“Build Settings”的“Other Linker Flags”中添加-ObjC。

So, in my experience this issue only happens when the flag -ObjC is present.

所以,根据我的经验,这个问题只发生在标志-ObjC存在时。

I tried all the solutions exposed in here but nothing worked for me, I hope anyone can bring more light on how to solve this issue even with the -ObjC flag active.

我尝试了在这里暴露的所有解决方案,但没有任何方法对我有用,我希望任何人都能更多地了解如何解决这个问题,即使-ObjC标志处于活动状态。

EDIT:

There's a question related to this, I'll put the link here in case is helpful to someone: Contradicting frameworks on -ObjC

有一个与此相关的问题,我将把这里的链​​接以防万一对某人有帮助:在-ObjC上有矛盾的框架

#5


i had some issue, i just remove Parser.framework in Linked Framework and Libraries and work well.

我有一些问题,我只是删除链接框架和库中的Parser.framework并且运行良好。

#1


Turns out the order in which you include/search the frameworks in your project matters.

结果是您在项目中包含/搜索框架的顺序。

Here is what I did to work with Parse 1.6.4 and FacebookSDK without CacoaPods

以下是我在没有CacoaPods的情况下使用Parse 1.6.4和FacebookSDK所做的工作

  1. Use the latest version of Bolts. (1.1.4)
  2. 使用最新版本的螺栓。 (1.1.4)

  3. Your include paths should be ordered to find Bolt first, then FacebookSDK, then Parse
  4. 您的包含路径应​​先订购,先找到Bolt,然后再找到FacebookSDK,再找Parse

Parse和Facebook SDK“螺栓”框架错误

#2


Well I found it. The problem was that old files (which were now deleted) were being referenced in the "Library Search Paths Flag". Thanks to this post for giving me the idea. All I had to do was delete the old paths and it now works again.

好吧,我找到了。问题是旧文件(现已删除)在“图书馆搜索路径标记”中被引用。感谢这篇帖子给了我这个想法。我所要做的就是删除旧路径,它现在又可以工作了。

EDIT: It appears that for some situations the order of the search paths matters as well (see below).

编辑:似乎在某些情况下搜索路径的顺序也很重要(见下文)。

#3


That worked for me Temporary workaround for Parse 1.6.4 and Facebook SDK 3.23

这对我有用Parse 1.6.4和Facebook SDK 3.23的临时解决方法

Add to your AppDelegate.m or another class following constant after imports and before implementation section: NSString *const BFTaskMultipleExceptionsException = @"BFMultipleExceptionsException";

在导入之后和实现之前添加到AppDelegate.m或其他类后面的常量部分:NSString * const BFTaskMultipleExceptionsException = @“BFMultipleExceptionsException”;

The explanation of the bug https://*.com/a/29136507/1345244

错误的解释https://*.com/a/29136507/1345244

One hack I found for working around missing symbols, was just redefining the missing symbol again in my code.

我找到了解决缺失符号的一个黑客,只是在我的代码中重新定义了丢失的符号。

The BFTaskMultipleExceptionsException string is defined here like this:

这里定义了BFTaskMultipleExceptionsException字符串,如下所示:

NSString *const BFTaskMultipleExceptionsException = @"BFMultipleExceptionsException"; So maybe just try putting that one line into your code?

NSString * const BFTaskMultipleExceptionsException = @“BFMultipleExceptionsException”;那么也许只是尝试将这一行放入您的代码中?

From the history on github, it looks like this was just added to Bolts about 19 days ago. Version 1.1.4 of Bolts was released 14 days ago (1.1.3 was from October last year). So it probably is caused by the version mismatch of Bolts that you noticed.

从github的历史来看,它似乎刚刚在19天前添加到Bolts。螺栓版本1.1.4在14天前发布(1.1.3从去年10月开始)。所以它可能是由你注意到的螺栓版本不匹配引起的。

Another option might be to get an older version of Parse from before Bolts 1.1.4 was released.

另一种选择可能是在Bolts 1.1.4发布之前获得较旧版本的Parse。

Presumably this will be fixed once a new Facebook SDK is available with Bolts 1.1.4.

据推测,一旦新的Facebook SDK可用于螺栓1.1.4,这将得到修复。

#4


same problem here.

同样的问题在这里

I had both frameworks included with no problem, until I added SponsorPay SDK which needs to add the -ObjC in "Other Linker Flags" on target "Build Settings".

我有两个框架没有问题,直到我添加了SponsorPay SDK,需要在目标“Build Settings”的“Other Linker Flags”中添加-ObjC。

So, in my experience this issue only happens when the flag -ObjC is present.

所以,根据我的经验,这个问题只发生在标志-ObjC存在时。

I tried all the solutions exposed in here but nothing worked for me, I hope anyone can bring more light on how to solve this issue even with the -ObjC flag active.

我尝试了在这里暴露的所有解决方案,但没有任何方法对我有用,我希望任何人都能更多地了解如何解决这个问题,即使-ObjC标志处于活动状态。

EDIT:

There's a question related to this, I'll put the link here in case is helpful to someone: Contradicting frameworks on -ObjC

有一个与此相关的问题,我将把这里的链​​接以防万一对某人有帮助:在-ObjC上有矛盾的框架

#5


i had some issue, i just remove Parser.framework in Linked Framework and Libraries and work well.

我有一些问题,我只是删除链接框架和库中的Parser.framework并且运行良好。