Archive validation error with Binary Swift Package and Appex

I am trying to include a binary swift package dependency in my app to upload to App Store connect. When doing so the framework is embedded in the app which is fine, unless I also want to use that dependency in an App Extension or an embedded App Clip. In those cases when I archive the framework is embedded in the extension and app clip as well which leads to the following errors during validation.


CFBundleIdentifier Collision. There is more than one bundle with the CFBundleIdentifier value 'com.company.frameworkName-Dynamic' under the iOS application 'MyApp.app'

Invalid Bundle. The bundle at 'MyApp.app/Plugins/MyAppExtension.appex' contains disallowed nested bundles.

Invalid Bundle. The bundle at 'MyApp.app/Plugins/MyAppExtension.appex' contains disallowed file 'Frameworks'

This issue has existed since at least Xcode 12.1 reported here in the Swift forums: https://forums.swift.org/t/swift-package-binary-framework-issue/41922


The XCFramework binary Swift Package archive was built and distributed using Xcode 12.5 build tools with Swift 5.4 tools in the Swift package. The archive is also built and validated using Xcode 12.5

Have the same issue. Did someone find a solution? The problem appeared only with Xcode 12.5, 12.4 validates the same project without any problems.

Archive validation error with Binary Swift Package and Appex
 
 
Q