Facebook sdk登录中的exc_bad_access Xcode 8 beta [英] exc_bad_access in Facebook sdk login Xcode 8 beta

查看:89
本文介绍了Facebook sdk登录中的exc_bad_access Xcode 8 beta的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,当我遇到一个奇怪的错误时,我开始添加我的应用程序IOS 10功能:

recently I started adding my application IOS 10 features while I encountered a weird bug:

当我在嵌入式浏览器中单击Facebook本身中的确认按钮时,通过浏览器使用facebook SDK进行身份验证时,应用程序崩溃.

When authenticating with facebook SDK via browser as soon as I click the confirmation button in facebook itself at the embeded browser, the app crashes.

不幸的是,该错误没有提供足够的信息,控制台没有告诉我任何有关该错误的信息,也没有调用堆栈来查看发生此异常的位置.

Unfortunately this bug is not informative, the console doesn't tell me anything about it and there is not call stack to see where this exception was occurred.

证明此错误的原因有两点: 1.如果通过系统帐户登录,则不会发生此错误,仅当在浏览器中进行登录时(如下图所示):

Two points for demonstrating this bug cause: 1. This bug doesn't occur if the login is via System account but only when it in browser as you can see in the next photo:

(一旦我点击确定",就会发生异常)

(As soon as I tap OK the exception occur)

  1. 当我通过Xcode 7.x运行我的应用程序时,该错误不会发生.因此,这可能与facebook SDK与新编译器或类似工具的集成有关.

希望有人对此有答案,或者希望我能如何调试这种毫无意义的错误. 提前致谢, 丽兰.

Hope someone has answer for that, or maybe an idea of how can I debug this kind of un informative bug. Thanks in advance, Liran.

推荐答案

我只是遇到类似问题,但不幸的是我没有时间去研究问题.但是我找到了这个网站,该网站很好地解释了它的工作原理以及调试方式:

I just ran into something similar but unfortunately i don't have the time to dig the problem. But i found this website, which explains pretty well how it works, and how you can debug it : What Is EXC_BAD_ACCESS and How to Debug It

所以,这就是发生此错误的原因:

So, here is why this error happens :

总而言之,当您遇到EXC_BAD_ACCESS时,这意味着您尝试将消息发送到无法执行该消息的内存块.

In summary, when you run into EXC_BAD_ACCESS, it means that you try to send a message to a block of memory that can't execute that message.

但是,在某些情况下,EXC_BAD_ACCESS是由损坏的指针引起的.每当您的应用程序尝试取消引用损坏的指针时,内核都会引发异常.

In some cases, however, EXC_BAD_ACCESS is caused by a corrupt pointer. Whenever your application attempts to dereference a corrupt pointer, an exception is thrown by the kernel.

本文提供的解决方案之一是使用 Zombie Objects :

One of the solutions given in this article is to use Zombie Objects :

单击左上角的活动方案,然后选择编辑方案".

Click the active scheme in the top left and choose Edit Scheme.

选择左侧的运行",然后在顶部打开诊断"选项卡.要启用僵尸对象,请选中标记为启用僵尸对象的复选框. 如果您现在遇到EXC_BAD_ACCESS,则Xcode控制台中的输出将使您更好地了解从何处开始搜索.

Select Run on the left and open the Diagnostics tab at the top. To enable zombie objects, tick the checkbox labeled Enable Zombie Objects. If you now run into EXC_BAD_ACCESS, the output in Xcode's Console will give you a much better idea of where to start your search.

它应该在日志中为您提供更多信息,因此您可以了解问题的根源.顺便说一句,它对我不起作用.

It should give you more information in the logs, so you could have an idea of what the root of the problem is. BTW, it didn't work for me.

另一种解决方案是使用 analyze Xcode工具检查代码中可能存在问题的区域. 按Shift-Cmd-B以使用它,或按Product -> Analyze 它应该显示您必须在Xcode左侧面板上的问题导航器"中检查的可能问题.单击该问题以显示对Xcode可疑的代码块,但它最终可能根本不是问题的一部分.

Another solution is to check possible problematics areas in your code with the analyze Xcode tool. Press Shift-Cmd-B in order to use it, or Product -> Analyze It should display the possible issues you have to check in the Issue Navigator on the left panel of Xcode. Click on the issue to display the block of code which is suspicious for Xcode, but which may finally not be a part of the problem at all.

有关更多信息,请检查上面的链接,我只是对文章中的内容进行了总结.

For more information, check on the link above, I just summed up what the article says.

这篇关于Facebook sdk登录中的exc_bad_access Xcode 8 beta的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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