App Widget validation failed - preparation for App Store upload

I am trying to upload my app to AppStore using Xcode. The app uses widgets, and after archiving the app, I run the validation. It reports two errors.

Invalid directory. The bundle Payload/……/…WidgetExtension.appex is not contained in a correctly named directory. It should be under "Plugins".

CFBundleIdentifier Collision. There is more than one bundle with the CFBundleIdentifier value '…widget' under the iOS application.

I suspect that the two are linked issues, and that whilst trying to debug the widget in a simulator I may have duplicated any entry somewhere in the settings, but I am not clear where to look, as widget appears in several places, to fix the issue - info.plist, Build settings, General tab, other?

The widget also appears in the 'Products' list along with the app. I am not sure if the widget should be there, and if not how to remove it from the 'Products' list, but still make it available in the app.

Answered by Greenamberred in 712780022

There was an additional instruction in the App's 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 it 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.

Examined the package contents of the archiving, and can see that there are two copies of the extension, one in the Plugins directory and one in the level above. So, the one that is outside the Plugins directory is the duplicate.

From the Xcode menu

  • 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

What I still need to determine is what are the commands or build settings that created it, how to change them and how to correctly change the set up so that the incorrect duplicate is not recreated in a future build.

Accepted Answer

There was an additional instruction in the App's 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 it 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.

App Widget validation failed - preparation for App Store upload
 
 
Q