Invalid Swift Support - The file libswiftAVFoundation.dylib doesn’t have the correct code signature.

I have a project that uses Swift and Objective, no Cocoapods.

Shortly after uploading my IPA through Application Loader I received this email from Apple:


Dear developer,

We have discovered one or more issues with your recent delivery for "EdgevisTest". To process your delivery, the following issues must be corrected:

Invalid Swift Support - The file libswiftAVFoundation.dylib doesn’t have the correct code signature. Make sure you’re using the correct signature, rebuild your app using the current public (GM) version of Xcode, and resubmit it. Don’t just modify the code signature of libswiftAVFoundation.dylib.

Once these issues have been corrected, you can then redeliver the corrected binary.

Regards,

The App Store team


I should point out that I have used a script to resign the IPA for a customer. Any ideas what I can do to sort this?


Attached below is the script I have used.


# !/bin/bash
SOURCEIPA="$1"
DEVELOPER="$2"
MOBILEPROV="$3"
TARGET="$4"
BUNDLE="$5"

unzip -qo "$SOURCEIPA" -d extracted
APPLICATION=$(ls extracted/Payload/)

#Remove the current code signature data.
rm -rf "extracted/Payload/$APPLICATION.app/_CodeSignature"

#Replace embedded provisioning profile with new one
cp "$MOBILEPROV" "extracted/Payload/$APPLICATION/embedded.mobileprovision"
echo "Resigning with certificate: $DEVELOPER"

find -d extracted  \( -name "*.app" -o -name "*.appex" -o -name "*.framework" -o -name "*.dylib" \) > directories.txt
if [[ "$BUNDLE" != 'null.null' ]]; then
   echo "Changing BundleID with : $BUNDLE"
   /usr/libexec/PlistBuddy -c "Set:CFBundleIdentifier $BUNDLE" "extracted/Payload/$APPLICATION/Info.plist"
fi
security cms -D -i "extracted/Payload/$APPLICATION/embedded.mobileprovision" > t_entitlements_full.plist
/usr/libexec/PlistBuddy -x -c 'Print:Entitlements' t_entitlements_full.plist > t_entitlements.plist
var=$((0))
while IFS='' read -r line || [[ -n "$line" ]]; do
  if [[ "$BUNDLE" != 'null.null' ]] && [[ "$line" == *".appex"* ]]; then
    echo "Changing .appex BundleID with : $BUNDLE.extra$var"
    /usr/libexec/PlistBuddy -c "Set:CFBundleIdentifier $BUNDLE.extra$var" "$line/Info.plist"
    var=$((var+1))
  fi  
  /usr/bin/codesign --continue -fv -s "$DEVELOPER" --entitlements "t_entitlements.plist"  "$line"
done < directories.txt

echo "Creating the Signed IPA"
cd extracted
zip -qry ../extracted.ipa *
cd ..
mv extracted.ipa "$TARGET"
rm -rf "extracted"
rm directories.txt
rm t_entitlements.plist
rm t_entitlements_full.plist
We ran into this issue too.Same Xcode version. We also checked ipa package, two frameworks under ***.app/frameworks/libswiftAVFoundation.dylib and swiftsupport/libSwiftAVFoundation.dylib have the same version.Can't figure out what to do.

Just hit this error. I rerun the latest-but-one build on our build server and submitted it. It went through fine. So I reran the latest build (i.e the git hash that failed the first time round) and submitted it. It went though fine....

I also hit that this morning, and I just bumped the build number and rebuilt the same one. It went through fine. This looks like the problem was on their end.

Same here. We haven't made any change for our builds. Suddenly getting this error for libSwiftCore.dylib

I See that happening from time to time, too. When I re-submit the same binary, it works. Must be a problem on Apple's end.

I accidentally embedded some static libs (xcframeworks) and got the same problem. Outbedding them helped.

Invalid Swift Support - The file libswiftAVFoundation.dylib doesn’t have the correct code signature.
 
 
Q