Due to a bug in Xcode, an empty Frameworks and SwiftSupport folder might be emitted when performing the Archive operation. Itunes Connect will then reject the build. Removing the empty Frameworks folder and SwiftSupport folder after archiving will cause the build the be accepted by Itunes Connect.
If your Frameworks folder is not empty, you might try the shell script below, which will copy certain items into the folders.
Go to Organizer -> Archives -> Right Click -> Show In Finder -> Right Click -> Show Package Contents -> Navigate to Product, Applications, Your App.app -> Right Click -> Show Package Contents
Now check if the Frameworks folder is empty. If it it, delete it and delete the SwiftSupport library which is higher up in the folder tree, directly inside the xcarchive folder.
Now in Organizer, click Distribute app. This time the build should be accepted.
If your Frameworks folder was not empty, then try the following shell script (please check the path variables before running):
Code Block XCARCHIVE_PATH="/Users/<user>/Library/Developer/Xcode/Archives/<Put .xcarchive path here>" |
APP="/Users/<user>/Library/Developer/Xcode/Archives/<Put path to .app inside .xcarchive here" |
|
DEVELOPER_DIR=`xcode-select --print-path` |
if [ ! -d "${DEVELOPER_DIR}" ]; then |
echo "No developer directory found!" |
exit 1 |
fi |
|
echo "+ Adding SWIFT support (if necessary)" |
if [ -d "${APP}/Frameworks" ]; |
then |
mkdir -p "${TEMP_IPA_BUILT}/SwiftSupport" |
|
for SWIFT_LIB in $(ls -1 "${APP}/Frameworks/"); do |
echo "Copying ${SWIFT_LIB}" |
cp "${DEVELOPER_DIR}/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/${SWIFT_LIB}" "${XCARCHIVE_PATH}/SwiftSupport" |
done |
fi |