Failed to launch home screen widget in iOS 14 Simulator

Viewed 2167

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)

4 Answers

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.

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

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.

Related