Exc_bad_access on Facebook sdk login Xcode 8 beta

I recently started adding my iOS 10 app features when I discovered a strange error:

When authenticating with the facebook SDK via the browser, as soon as I press the confirmation button in facebook itself on the built-in browser, the application crashes.

enter image description here Unfortunately, this error is not informative, the console does not tell me anything about it, and there is no call stack to see where this exception occurred.

Two points to demonstrate this error: 1. This error does not occur if the system is logged in through the System account, but only when it is in the browser, as you can see in the following photo: enter image description here

(As soon as I touch OK, an exception is raised)

  1. When I run my application through Xcode 7.x, an error does not occur. So this is probably due to the integration of the facebook SDK with the new compiler or something like that.

I hope someone has an answer to this, or maybe the thought of how I can debug this uninformative error. Thanks in advance, Liran.

+8
facebook ios10 xcode8 facebook-ios-sdk exc-bad-access
source share
2 answers

I just ran into something similar, but unfortunately I don't have time to dig up the problem. But I found this site that explains very well how it works and how it can be debugged: What is EXC_BAD_ACCESS and how to debug it

So this is why this error occurs:

In general, when running in EXC_BAD_ACCESS, this means that you are trying to send a message to a memory block that cannot execute this message.

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

One solution provided in this article is to use Zombie objects :

Click the active diagram in the upper left corner and select "Edit Schema".

Select Run on the left and open the Diagnostics tab at the top. To enable zombie objects, check the box next to "Enable zombie objects." If you run EXC_BAD_ACCESS now, the output in the Xcode console will give you a much better idea of ​​where to start the search.

He should give you more information in the magazines so you can understand what the root of the problem is. By the way, this did not work for me.

Another solution is to check for possible problem areas in the code using the Xcode Parser tool. Press Shift-Cmd-B to use it, or Product -> Analyze It should display possible problems that you should check in the Problem Navigator in the left Xcode pane. Click on a problem to display a block of code that is suspicious of Xcode, but which may not be part of the problem at all.

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

0
source share

I also came across this problem. One of the UIApplication delegate methods seems to have been deprecated in iOS 9 and supposedly removed in iOS 10.

 optional func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool 

I replaced it with the following method:

 func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool { return FBSDKApplicationDelegate.sharedInstance().application(app, open: url, sourceApplication: options[.sourceApplication] as! String, annotation: options[.annotation]) } 
+4
source share

All Articles