Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swift keyboard extension SIGQUIT, Execution was interrupted, reason: EXC_BREAKPOINT

When I try to build and run my keyboard extension, it sometimes just crashes with a Thread 1: signal SIGQUIT.

I am not able to reproduce the error. Sometimes I can build and run my app but most of the time the keyboard just quits. This happens on an actual device. In the simulator it does not open my keyboard and says Waiting to Attach.

The console does not output any errors at first. However, if I change the dropdown to View UI Hierachy in the Debug navigator I get the following description:

Details:  No plist data for fetching view hierarchy: error evaluating expression “(id)[(Class)objc_getClass("DBGViewDebuggerSupport_iOS") fetchViewHierarchyWithOptions:(id)[(Class)objc_getClass("NSDictionary") dictionaryWithObjects:(id)[(id)[(id)[(Class)objc_getClass("NSArray") arrayWithObject:(id)[(Class)objc_getClass("NSNumber") numberWithBool:1]] arrayByAddingObject:(id)[(id)[(Class)objc_getClass("NSArray") arrayWithObject:@"_UIVisualEffectBackdropView"] arrayByAddingObject:@"_UIBackdropEffectView"]] arrayByAddingObject:(id)[(Class)objc_getClass("NSNumber") numberWithBool:0]] forKeys:(id)[(id)[(id)[(Class)objc_getClass("NSArray") arrayWithObject:@"DBGViewDebuggerUseLayersAsSnapshots"] arrayByAddingObject:@"DBGViewDebuggerEffectViewsToSnapshotAsImage"] arrayByAddingObject:@"DBGViewDebuggerAlwaysEncodeLayers"]]]”: error: Execution was interrupted, reason: EXC_BREAKPOINT (code=1, subcode=0x18daddc34).
The process has been returned to the state before expression evaluation.

Method:   -[DBGAbstractViewDescriber handleFetchedViewInfo:fetchError:resultHandler:]
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.

I also took a screenshot of the processes.

enter image description here

Am I doing something wrong and how could I prevent that my keyboard extension quits all the time when running it? Is it actually a bug as it says in the description?

like image 913
Yannick Avatar asked Dec 21 '16 10:12

Yannick


1 Answers

DISCLAIMER

It seems like something in xCode 8.2.1 is broken and the debugger is not correctly attaching to the correct process or the hosting process is not properly loading the new code.

This is a not a permanent solution but a temporary workaround.

WORKAROUND

I have been able to work around this issue by following the steps below.

  1. Kill any process that is using your keyboard (important!)
  2. Launch the application using the debugger so the latest code is deployed to the device
  3. Navigate to Settings > General > Keyboards > etc.
  4. Remove your custom keyboard
  5. Re-add your custom keyboard
  6. Debug the application once again

The reason this works is because removing the keyboard kills the process that is hosting the extension allowing Xcode to attach to the new binary.

like image 194
Randy Avatar answered Nov 15 '22 19:11

Randy