When adding a Swift Binary Package to an Xcode project that also have an extension the binary package will be copied both to the Plugins folder and the Frameworks folder.
This is also happening to me and is preventing me from deploying to Itunes. I get a Transporter Error:
[04:36:09]: [Transporter Error Output]: ERROR ITMS-90680: "Invalid directory. The bundle Payload/BinarySPMTest.app/PlugIns/Binary.framework is not contained in a correctly named directory. It should be under "Frameworks"."
[04:36:09]: [Transporter Error Output]: ERROR ITMS-90685: "CFBundleIdentifier Collision. There is more than one bundle with the CFBundleIdentifier value 'com.test.binary' under the iOS application 'Test.app'."
[04:36:09]: [Transporter Warning Output]: WARNING ITMS-90806: "CFBundleIdentifier collision. Each bundle must have a unique bundle identifier. The bundle identifier 'com.test.binary' is used in the bundles '[Payload/BinarySPMTest.app/Frameworks/Binary.framework, Payload/BinarySPMTest.app/PlugIns/Binary.framework]'"
[04:36:10]: Transporter transfer failed.
I was able to remove the frameworks in the PlugIns folder via a Run Script build phase (specify the path to each framework in input files - $(BUILT_PRODUCTS_DIR)/$(PLUGINS_FOLDER_PATH)/Binary.framework):
#!/bin/bash
COUNTER=0
while [ $COUNTER -lt "${SCRIPT_INPUT_FILE_COUNT}" ]; do
tmp="SCRIPT_INPUT_FILE_$COUNTER"
FILE=${!tmp}
echo "Removing $FILE"
rm -rf "$FILE"
let COUNTER=COUNTER+1
done
For more information about this issue, it started happening when we migrated to use Plaid's Swift Package, on Xcode 12.2. Plaid uses binary framework in their Swift Package, so we had to add a Run Script with the script above, and input files as $(BUILT_PRODUCTS_DIR)/$(PLUGINS_FOLDER_PATH)/LinkKit.framework
This resolved both of the Transporter Errors mentioned above, ERROR ITMS-90680 and ERROR ITMS-90685.
Had the same issue with the OneSignal framework. Thanks for the explanation on the source of the problem. I wasn't able to make the script run, apparently 'cause I needed to change the Build System to the legacy one but that brought some issues with the OneSignalServiceExtension not being able to load the module.
Finally I got to fix the issue by deleting the framework after archiving. The steps were:
Archive
Show in finder
Right click > Show package contents of the .xcarchive
Products > Applications > xx.app > Right click Show package contents
Plugins > Delete the .framework
Go to Trash bien and permanent delete the .framework
After that just proceed to upload to Apple connect as usual, should be able to proceed.
We experienced a similar issue in Xcode 12.4 where a binary framework would be copied twice in to the archive, both in . and ./frameworks. The framework is depended by both another dependency and the app itself, so that might be the reason why it got copied twice.
Upgrading to Big Sur and Xcode 12.5 toolchain solved the problem.