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.
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.