6

Error Details:

SendProcessControlEvent:toPid: encountered an error: Error Domain=com.apple.dt.deviceprocesscontrolservice Code=8 "Failed to show Widget 'com.anupam.iOS14Feature.widgetExtension' error: Error Domain=SBAvocadoDebuggingControllerErrorDomain Code=2 "Please specify the widget kind in the scheme's Environment Variables using the key '_XCWidgetKind' to be one of: 'BillPayCheckerWidget', 'CommitCheckerWidget'" UserInfo={NSLocalizedDescription=Please specify the widget kind in the scheme's Environment Variables using the key '_XCWidgetKind' to be one of: 'BillPayCheckerWidget', 'CommitCheckerWidget'}." UserInfo={NSLocalizedDescription=Failed to show Widget 'com.anupam.iOS14Feature.widgetExtension' error: Error Domain=SBAvocadoDebuggingControllerErrorDomain Code=2 "Please specify the widget kind in the scheme's Environment Variables using the key '_XCWidgetKind' to be one of: 'BillPayCheckerWidget', 'CommitCheckerWidget'" UserInfo={NSLocalizedDescription=Please specify the widget kind in the scheme's Environment Variables using the key '_XCWidgetKind' to be one of: 'BillPayCheckerWidget', 'CommitCheckerWidget'}., NSUnderlyingError=0x7fc70d618350 {Error Domain=SBAvocadoDebuggingControllerErrorDomain Code=2 "Please specify the widget kind in the scheme's Environment Variables using the key '_XCWidgetKind' to be one of: 'BillPayCheckerWidget', 'CommitCheckerWidget'" UserInfo={NSLocalizedDescription=Please specify the widget kind in the scheme's Environment Variables using the key '_XCWidgetKind' to be one of: 'BillPayCheckerWidget', 'CommitCheckerWidget'}}} Domain: DTXMessage Code: 1 --

System Information

macOS Version 10.15.6 (Build 19G73) Xcode 12.0 (17200.1)

Anupam Mishra
  • 3,408
  • 5
  • 35
  • 63

4 Answers4

6

likely because you changed the kind string inside of your :widget struct. Go to edit your scheme, and in arguments, change the name of _XCWidgetKind to one of your new kind names. Literally just loaded this fix into my simulator as i typed this lol.

  • I am having the same problem. I have two widgets. Each one runs fine independently, but when I add them to a WidgetBundle and set the @main wrapper to the bundle and remove it from each of the Widgets I get the same error. There are no entries for the _XCWidgetKind value when I run each widget independently. Any ideas on what the issue is and how to resolve it? – Stewart Lynch Oct 01 '20 at 00:28
  • 1
    @StewartLynch, I get the same problem too. this article solved the problem. https://developer.apple.com/forums/thread/657599 – John Oct 07 '20 at 07:55
3

If you have multiple widgets, in my case I have two widget.

  1. Static Configuration widget
  2. Intent Configuration widget

And, when you run your widget extension target, you need to specify which widget you want to run.

Product -> Scheme -> Edit scheme

  1. Enable _XCWidgetKind and provide the wiget struct name [in my case "Selectable_OTP_Extn"]
  2. Enable XCWidgetDefaultView & _XCWidgetFamily

enter image description here

Azhagusundaram Tamil
  • 2,053
  • 3
  • 21
  • 36
1

I tried other answers but for multiple Widgets (i.e. WidgetBundle) only this answer helped me: https://stackoverflow.com/a/64000716/2095408 (comment other Widgets and leave just 1 Widget uncommented).

Palli
  • 510
  • 6
  • 14
0

If you have many different widgets in your app, you need to tell Xcode which one you are going to debug, you can't debug all of them at the same time, that's what _XCWidgetKind is for, so add the Class name of your widget works.

Santiago
  • 448
  • 3
  • 12