We are trying to upload new build for our already existing app to appstore, with a build script to embed framework(Which is just copying from build directory to MyApp.app/Frameworks). Everything builds and works fine in my local machine. But getting this error while uploading to appstore.
ITMS-90432: Invalid Swift Support - The file MyApp.app/Frameworks/Framework1.framework, MyApp.app/Frameworks/Framework2.framework doesn’t have the correct file type for this location. Ensure you’re using the correct file, rebuild your app using the current public (GM) version of Xcode, and resubmit it.
We are copying to the correct directory, but still getting the above error while uploading.
We found similar issue here. But there it was obvious that info.plist file is in wrong location. But in our case its in the correct location.
Attaching the script we are using. This we are adding in run script in build phase.
frameworks_used_in_extensions=("Framework1" "Framework2")
# Loop over the array
for MODULE in "${frameworks_used_in_extensions[@]}"
do
export LIBRARY_SEARCH_PATHS="${LIBRARY_SEARCH_PATHS}":"${SDKROOT}/${MODULE}.framework/"
cp -Rv "${BUILT_PRODUCTS_DIR}/${MODULE}.framework" "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/Frameworks/"
CODE_SIGN_IDENTITY_FOR_ITEMS="${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
if [ "${CODE_SIGN_IDENTITY_FOR_ITEMS}" = "" ] ; then
CODE_SIGN_IDENTITY_FOR_ITEMS="${CODE_SIGN_IDENTITY}"
fi
codesign --force --verbose --sign "${CODE_SIGN_IDENTITY_FOR_ITEMS}" "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/Frameworks/${MODULE}.framework/${MODULE}"
done
This can create an alias
/shortcut
of the embedded frameworks. Hence they are not the correct file types under MyApp.app/Frameworks/
use the following to make a proper copy of the frameworks
cp -r pathToSource.framework pathToDestination.framework