1

I know this kind of question is kind of asked a lot but it's a bit different that i could not find elsewhere .

Age old "Fatal error: Unexpectedly found nil while unwrapping an Optional value" we face everyday but usually it states to the point or line in the code where it is trying to unwrap an optional value and it is nil .

But in my case it is redirecting me to AppDelegate class due to which i don't know where it is exactly crashing .

Now my point is that is there any way to figure out which variable was being unwrapped that caused the crash.

The Debugger window does not state anything as well . Just the same Unwrapping optional- nil - failed statement

App Delegate unwrapping failed

Debugger Area

Following are the debugger commands that i used and their output after that :

Blue - App name

Red - Framework that we are using inside the app

di

di debugger command

thread backtrace

enter image description here

Community
  • 1
  • 1
user121095
  • 697
  • 2
  • 6
  • 18
  • 1
    Try setting a breakpoint on it to hunt it down https://stackoverflow.com/a/35514845/3141234 I suspect it has to do with something crashing during the initialization of your VCs – Alexander Sep 17 '19 at 11:06
  • Is is in Debug mode or it's a Release? – Mojtaba Hosseini Sep 17 '19 at 11:07
  • Can you type in lldb `di` upon the error and include the output? – Kamil.S Sep 17 '19 at 18:46
  • @Alexander It's not working – user121095 Sep 19 '19 at 10:11
  • @Kamil.S I did and there is bunch of text in the debugger . Will that provide anything ? – user121095 Sep 19 '19 at 10:11
  • @user121095 yes please include the yielded output in your question. – Kamil.S Sep 19 '19 at 10:29
  • Also `thread backtrace` please – Kamil.S Sep 19 '19 at 10:31
  • @Kamil.S Please check the updated question – user121095 Sep 19 '19 at 11:48
  • 1
    @user121095 it seems it fails in some asynchronously called Swift closure of the "red" framework. That's why you don't get a straightforward stacktrace. The `saveLocation` arg is a hint what kind of function/method it might be. I'd try commenting calls to "red" framework API one at a time trying to narrow it down. I assume you don't have the source code of the "red" framework, correct?. – Kamil.S Sep 19 '19 at 11:57
  • @Kamil.S Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/199684/discussion-between-user121095-and-kamil-s). – user121095 Sep 19 '19 at 12:01

0 Answers0