WWDC22 SALE: Save 50% on all my Swift books and bundles! >>

SOLVED: Validation error for duplicated widget in Xcode Archive

Forums > iOS

As part of the upload of an application to App Store using Xcode, I run a validation of the archive prior to the upload.

I had a problem with an app, where the widget I had created appeared both in the Plugins folder, and in the folder directly above it. FYI - the current situation is that when you create a widget extension, Xcode build will, if your settings are correct, automatically put it in the Plugins folder.

For some reason and somehow, I manage to create a duplicate of the widget extension in the directory above the Plugins folder.

I have examined the build settings and commands and have not yet been able to determine where I had changed them to cause this situation. Although I can fix the archive to remove the duplicated widget, that is only a workaround. The problem will return the next time I build and archive the app. The right step is to fix the build commands or other settings to avoid this reoccurring.

If there is anyone who can help me it would be much appreciated.

For those interested I have listed the step to examine an archive (for widgets) below.

Do not use the commands on any archives for an app that you have submitted to Apple App Store or have app that you are actively distributing.

Excrcise caution when accessing the contents of the archive directly.

  • Select Windows\Organiser
  • Select the archive, and click to show in Finder
  • Right click to show the package contents of the .xcarchive file
  • In Products\Applications find the .app file
  • Right click on the .app file to show the package contents
  • Examine the Plugins directory for the widget extension
  • Examine sub-directories and higher level directories to find the duplicate widget extension


In the main app build settings, there was an additional instruction in the Bundle Copy parameters, to copy the widget extension in to the bundle. So, not only was the widget extension being embedded, I was also separately copying in to the App's bundle.

Uncertain how and when I managed to add this instruction in to the Bundle Copy parameters, however I have confirmed that removing the instruction has fixed the problem with the archive and it now passes the Xcode validation for upload to App Store.


How you fixed it. Even I followed the steps mentioned here. But have the same issue facing on setup guide. I tried different method. Now I am planing to hire an expert for it. If you explain in an easy way that how you fixed it I will be thank ful.


Save 50% in my Black Friday sale.

SAVE 50% To celebrate WWDC22, all our books and bundles are half price, so you can take your Swift knowledge further without spending big! Get the Swift Power Pack to build your iOS career faster, get the Swift Platform Pack to builds apps for macOS, watchOS, and beyond, or get the Swift Plus Pack to learn advanced design patterns, testing skills, and more.

Save 50% on all our books and bundles!

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

Unknown user

You are not logged in

Log in or create account

Link copied to your pasteboard.