UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

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.


Hacking with Swift is sponsored by Superwall

SPONSORED Superwall lets you build & test paywalls without shipping updates. Run experiments, offer sales, segment users, update locked features and more at the click of button. Best part? It's FREE for up to 250 conversions / mo and the Superwall team builds out 100% custom paywalls – free of charge.

Learn More

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

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

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.