Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invalid Swift Support - Files don't match Xcode 10.1

I know there are similar questions are out there! But, they are old. We have released to iTunes before, never faced an issue. We have bunch of sub projects and also cocoapods. Not sure what could be the issue.

enter image description here

like image 605
Dheeraj Avatar asked Nov 08 '18 19:11

Dheeraj


1 Answers

Xcode 10.1 has this line in the release notes:

The App Store and TestFlight don't accept submissions containing arm64e. Xcode will remove arm64e content from your app when you distribute from the Organizer window.

In our case, this was the key to fixing it. Our CI uses xcodebuild to compile and archive the IPA, and then uses fastlane to upload it. The first step is to unzip the IPA archive.

Doing that gives us the Swift standard libraries in a SwiftSupport folder and in the application's frameworks folder. Using that release note as a hint, we found that the standard libraries in Xcode 10.1 are shipped with 4 architectures:

% file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/libswiftCore.dylib 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/libswiftCore.dylib: Mach-O universal binary with 4 architectures: [arm_v7:Mach-O dynamically linked shared library arm_v7] [arm64]
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/libswiftCore.dylib (for architecture armv7):  Mach-O dynamically linked shared library arm_v7
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/libswiftCore.dylib (for architecture armv7s): Mach-O dynamically linked shared library arm_v7s
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/libswiftCore.dylib (for architecture arm64):  Mach-O 64-bit dynamically linked shared library arm64
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/libswiftCore.dylib (for architecture cputype (16777228) cpusubtype (2)):  Mach-O 64-bit dynamically linked shared library arm64

Note the last one, which is in an unknown architecture. That's arm64e. If you upload with these files as is, TestFlight/iTunesConnect will reject your binary with the message you are getting.

For us, the solution was to copy over the standard libraries, use lipo to remove the arm64e slice, then sign them with our distribution certificate. Then we can repackage the IPA archive and upload it.

Hope that helps. It's not clear how you are building your application for submission, so this might be tougher for you to deal with, but for us it wasn't hard to modify our build scripts once we realized what was going on.

like image 196
Scott K. Avatar answered Nov 14 '22 12:11

Scott K.