9

Swift 5, Xcode 10

Xcode is logging a weird error that's only happening when I'm doing something really specific:

My app connects to an FTP server after clicking on the "login" button but if there's no internet connection, it displays a dialog with two options: 1. Switch to offline mode, 2. Retry. If I pick "retry", connect the device to the internet, then hit the "login" button again, this error is thrown. If I switch to offline mode or if there's already an internet connection before I hit the "login" button, there's no error message.

Everything works just fine afterwards but I'd still like to get rid of it - if possible:

2019-07-10 16:43:18.233414+0200 myapp[5256:111188] [] nw_dictionary_copy called with null dictionary
2019-07-10 16:43:18.235183+0200 myapp[5256:111188] [] __nwlog_err_simulate_crash simulate crash failed "nw_dictionary_copy called with null dictionary"
2019-07-10 16:43:18.237115+0200 myapp[5256:111188] [] nw_dictionary_copy called with null dictionary, dumping backtrace:
        [x86_64] libnetcore-1229.250.15
    0   libnetwork.dylib                    0x000000010c35c3b8 __nw_create_backtrace_string + 120
    1   libnetwork.dylib                    0x000000010c2b74e3 nw_dictionary_copy + 643
    2   libnetwork.dylib                    0x000000010c2fffe8 __nw_path_watch_simulator_network_changes_block_invoke + 40
    3   libsystem_notify.dylib              0x00000001090429b3 notify_register_mach_port + 7676
    4   libdispatch.dylib                   0x0000000108d82725 _dispatch_block_async_invoke2 + 83
    5   libdispatch.dylib                   0x0000000108d74db5 _dispatch_client_callout + 8
    6   libdispatch.dylib                   0x0000000108d7e792 _dispatch_workloop_invoke + 3251
    7   libdispatch.dylib                   0x0000000108d86ea3 _dispatch_workloop_worker_thread + 733
    8   libsystem_pthread.dylib             0x000000010915d611 _pthread_wqthread + 421
    9   libsystem_pthread.dylib             0x000000010915d3fd start_wqthread + 13
2019-07-10 16:43:18.241412+0200 myapp[5256:111188] [] nw_dictionary_apply called with null dictionary
2019-07-10 16:43:18.241561+0200 myapp[5256:111188] [] __nwlog_err_simulate_crash simulate crash failed "nw_dictionary_apply called with null dictionary"
2019-07-10 16:43:18.241923+0200 myapp[5256:111188] [] nw_dictionary_apply called with null dictionary, dumping backtrace:
        [x86_64] libnetcore-1229.250.15
    0   libnetwork.dylib                    0x000000010c35c3b8 __nw_create_backtrace_string + 120
    1   libnetwork.dylib                    0x000000010c2b6bf9 nw_dictionary_apply + 249
    2   libnetwork.dylib                    0x000000010c300002 __nw_path_watch_simulator_network_changes_block_invoke + 66
    3   libsystem_notify.dylib              0x00000001090429b3 notify_register_mach_port + 7676
    4   libdispatch.dylib                   0x0000000108d82725 _dispatch_block_async_invoke2 + 83
    5   libdispatch.dylib                   0x0000000108d74db5 _dispatch_client_callout + 8
    6   libdispatch.dylib                   0x0000000108d7e792 _dispatch_workloop_invoke + 3251
    7   libdispatch.dylib                   0x0000000108d86ea3 _dispatch_workloop_worker_thread + 733
    8   libsystem_pthread.dylib             0x000000010915d611 _pthread_wqthread + 421
    9   libsystem_pthread.dylib             0x000000010915d3fd start_wqthread + 13

The only dictionary I'm using (afaik) is Bundle.main.infoDictionary?["CFBundleShortVersionString"] to display the version number but the error is logged even without this line of code. I'm also using the built in JSON parser (with Codable) but an error like that would be logged as a custom error message (which this one clearly isn't).

What does this error mean and how do I fix it?

I know that you can set up automatic break points that point you to the more or less exact line of code that's causing an error but what symbol/condition would I need to add one for this?

12
  • I also have this issue in my Xamarin Forms app. Have you found an answer @Neph? Commented Sep 3, 2019 at 20:14
  • @RyanBuening I think I just ended up ignoring it because it didn't seem to actually affect anything. Sorry, I can't check if it's still there at the moment and I can't say when I'm going to get the chance to check on the Mac. What is your app doing that might cause this?
    – Neph
    Commented Sep 6, 2019 at 10:54
  • Hey, thanks for the reply. I'm not sure what the app is doing to cause this. It's very strange. Like you said it doesn't appear to be affecting anything. Guess I'll just keep an eye on it. Thanks. Commented Sep 6, 2019 at 17:55
  • What are you doing with the app when it happens? Does it use any extra libraries?
    – Neph
    Commented Sep 9, 2019 at 8:37
  • 3
    @RyanBuening I started developing a new app a couple of weeks ago and never got these errors with it. Today I added the Reachability class (which I'm also using in my other app) to it and when I unplugged the LAN cable of my Mac Mini (while the app was running in the simulator) the error popped up again. All I'm doing is this: 1st line: let reachability = Reachability()!, 2nd line: if reachability.connection != .none {....} else {...}. Removing the 2nd line also gets rid of the error. Are you using this class too?
    – Neph
    Commented Dec 3, 2019 at 15:41

1 Answer 1

0

just clean the old build data from xcode Product --> clean build folder

and build again there will be new error tips

Not the answer you're looking for? Browse other questions tagged or ask your own question.