31

After adding an extension target to Xcode project and trying to run it on iOS 14, I'm getting an error:

SendProcessControlEvent:toPid: encountered an error: Error Domain=com.apple.dt.deviceprocesscontrolservice Code=8 "Failed to show Widget '***' error: Error Domain=SBAvocadoDebuggingControllerErrorDomain Code=1 "Failed to get descriptors for extensionBundleID (***)" UserInfo={NSLocalizedDescription=Failed to get descriptors for extensionBundleID (***)}." UserInfo={NSLocalizedDescription=Failed to show Widget '***' error: Error Domain=SBAvocadoDebuggingControllerErrorDomain Code=1 "Failed to get descriptors for extensionBundleID (***)" UserInfo={NSLocalizedDescription=Failed to get descriptors for extensionBundleID (***)}., NSUnderlyingError=0x7f9bac015910 {Error Domain=SBAvocadoDebuggingControllerErrorDomain Code=1 "Failed to get descriptors for extensionBundleID (***)" UserInfo={NSLocalizedDescription=Failed to get descriptors for extensionBundleID (***)}}} Domain: DTXMessage Code: 1

Any idea what is going wrong?

Vladyslav Zavalykhatko
  • 15,202
  • 8
  • 65
  • 100

13 Answers13

17

I resolved this problem. Clean Builder Folder(maybe it's not necessary), then restart your iPhone. Run your project again.

SuperDJ
  • 179
  • 2
8

For me it was that my device was on iOS 14.1 and the Deployment Target was set to 14.3 for the widget target. The solution was to update the Deployment Target to match your device or lower. The Deployment Target setting is in the General tab and under Deployment Info (in my case I set it to 14.0).

Cody
  • 650
  • 9
  • 16
4

If you have 2 widgets within your target, comment out the widget(s) you arent currently testing

@main
struct Widgets: WidgetBundle
{
    @WidgetBundleBuilder
    var body: some Widget
    {
        Widget1()
//        Widget2()
    }
}
CA Bearsfan
  • 454
  • 4
  • 20
4

For me the problem was the excluded arm64 architecture for any iOS simulator on the widget target build settings (Added because of my M1 development device).

When removing this excluded architecture, the widget is running without any problem.

obit
  • 167
  • 1
  • 6
1

If the extension target you added was for a Widget...

I did follow some of the suggestions here and restarted my phone to some success but the error kept happening over and over, and restarting my phone is intrusive and takes kind of a long time. For me, the workaround when I get this popup error is to..

1. On my iPhone, I find the Widget I'm working on and delete it by pressing and holding the widget until it gives me the option to remove it from my device.

2. In Xcode, I build and run the Widget Scheme again, and no more error!

It's a little faster, and I don't have to restart my phone.

Note: If for some reason that doesn't work, I switch my build Scheme back to my iPhone Scheme, build and run, then change the Scheme back to my widget Scheme, and that usually does the trick.

Dave Levy
  • 1,036
  • 13
  • 20
1

I ran into the exact same issue.

For me it happens when I ran an extension widget from an M1 computer.

Turns out the issue was I was running Xcode with Rosetta, turning that off fixed it for me.

To enable / disable rosetta:

  1. Right click on the Xcode app
  2. Click on Get Info
  3. Untick Open using Rosetta
  4. Clean project => Restart Xcode
Rom.
  • 2,800
  • 2
  • 17
  • 19
1

For me this was fixed

  • running the app scheme instead of the widget extension scheme first
  • trust the developer
  • then I switched to run the widget extension scheme.
sebassdc
  • 11
  • 2
0

Try to go to Setting -> General -> Profiles & Device Management -> Trust your cert, and then rebuild and rerun app.

Lê Vũ Huy
  • 714
  • 6
  • 16
0

This happened to me after moving my entitlements file from the root directory into the widget's directory. I tried this answer but the problem persisted.

I had to manually install the widget on the Home Screen. After that running from Xcode worked again.

arsenius
  • 12,090
  • 7
  • 58
  • 76
0

Short answer:
Make sure that your extension (e.g. a widget target) has its entry point marked with @main.

Long answer:
I had an app with watchOS widgets, and I am developing additional iOS widgets. I added a new target, and it worked. Both extensions had their own entry point marked with @main.
Then I realized that nearly all of the code was the same for both targets. I merged them and removed the individual files. But I forgot to mark the new code with @main. This caused the error.
As soon as I added @main, everything worked again.

Reinhard Männer
  • 14,022
  • 5
  • 54
  • 116
0

Same happened to me and the issue was because the Runpath Search Paths (LD_RUNPATH_SEARCH_PATHS) was empty. I cleared that build setting by mistake. I added @executable_path/Frameworks to the Runpath Search Paths, which was the right setting for my case, and the widget started working again.

ricardopereira
  • 11,118
  • 5
  • 63
  • 81
0

For me what did not fix it was cleaning derived data, restarting the simulator etc (well, maybe they also helped). What got it working was re-deploying the main app first, before running the WidgetExtension scheme once more.

Note: I first had to fix the bundle ID of my main app because it did not have the same prefix as the widget extension target did. So probably that's why the main target needed deploying again first.

Ian Dundas
  • 553
  • 1
  • 6
  • 17
-2

As mentioned here https://developer.apple.com/forums/thread/651611, setting New Build System in File -> Workspace/Project settings (for both Shared and Per User settings) seems to do the trick. You won't get rid of the warning, but the widget might (see notes) run.

Note 1 - even after this change, there seems to be about 30 % chance that it wont run. Just hit Run again ‍♂️. (Debug Navigator stuck on Waiting to Attach)

Note 2 - sometimes this doesn't work altogether. Setting Build System to Legacy and back to New worked for me ‍♂️.

Note 3 - running on device is so far without these problems (iOS 14 beta 7)

Tested on Xcode 12 beta v6.

janh
  • 232
  • 2
  • 9