Xcode 15 beta 2: Failed to install iOS app with widget extension to simulator or device, because widget extension is does not define either an NSExtensionMainStoryboard or NSExtensionPrincipalClass key with a string value in the NSExtension dictionar

Xcode: Version 15.0 beta 2 (15A5161b) iPhone: iOS 17.0 (21A5268h)

Run from Xcode to Simulator or my iPhone, build successfully, install failed with the same error:

My widget extension target info.plist file looks like the image below, and it worked find with all the previous Xcode version.

After adding the key NSExtensionPrincipalClass like this:

I can install my app to simaltor and my device, however, when archive and upload to the App Store (for TestFlight testing), i got another error (the first one is related to this issue, the second i could not figure out what it is):

Answered by Alen Liang in 757500022

After set my debug target to iOS 17, i can install my app to my device now.

Accepted Answer

After set my debug target to iOS 17, i can install my app to my device now.

-- deleted --

I have the same problem. Setting the minimum deployment to 17 allowed me to install on my device (ad-hoc). Then I tried to build for release but the organizer won't upload with the same error: NSExtensionPrincipalClass is unexpected.

So I removed NSExtensionPrincipalClass, recompiled and uploaded successfully. However when trying to install from TestFlight, it failed because NSExtensionPrincipalClass is missing. The console shows:

"Appex bundle at /var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.kfzF1C/extracted/Payload/.app/PlugIns/XXXWidgetExtension.appex with id com..***.widget does not define either an NSExtensionMainStoryboard or NSExtensionPrincipalClass key with a string value in the NSExtension dictionary in its Info.plist"

So - with NSExtensionPrincipalClass - can't upload to appstore. Without NSExtensionPrincipalClass can't install because it's missing. What's the deal!?

Xcode 15 beta 2: Failed to install iOS app with widget extension to simulator or device, because widget extension is does not define either an NSExtensionMainStoryboard or NSExtensionPrincipalClass key with a string value in the NSExtension dictionar
 
 
Q