Xamarin.Swift icon indicating copy to clipboard operation
Xamarin.Swift copied to clipboard

Invalid Swift Support: `incorrect code signature` or `SwiftSupport folder is missing`

Open alexeystrakh opened this issue 5 years ago • 3 comments

Summary

I'm working on my Swift 5.1 Framework Xamarin binding and was able to run it on an iOS 13 device and a simulator and even was able to validate against AppStore and uploaded it to the AppStore once the validation gave me no errors. The issue starts when I try to it on an iOS 12 device/simulator and (it was expected) it crashed because libswiftCore.dylib is missing. I’ve included the Xamarin.Swift 1.0.4 nuget and it worked, I was able to run it on the iOS 12 device. But when I pushed it to the AppStore - it gives me the missing SwiftSupport folder error:

ITMS-90426: Invalid Swift Support - The SwiftSupport folder is missing. Rebuild your app using the current public (GM) version of Xcode and resubmit it.

It seems that the step to create the SwiftSupport folder is manual and I followed instructions and ran this ipa-packager script to copy frameworks if required, basically the script just checks if there are any dylibs in the Framework folder of a given .app (and I do have a few). Eventually, the script is trying to find a singed version of the same dylib here /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/ but this folder in my dev env doesn’t have any, and the SwiftSupport folder ends up to be empty. When I try to publish new IPA with an empty SwiftSupport folder I can pass the error about missing folder but the first dylib check gives me an error right away:

ITMS-90433: Invalid Swift Support - The file libswiftCore.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 libswiftCore.dylib.

Please advise how I can properly include the valid swift images into my payload. Did I miss an important step?

My environment

Xcode: 11.1 Swift: 5.1 iOS: 12.1+ VS4Mac: 8.3.1

Sample

My repo sample with the Swift Framework and Xamarin Sample app

alexeystrakh avatar Nov 04 '19 21:11 alexeystrakh

@Flash3001 Lucas, did you have a chance to look into this issue?

alexeystrakh avatar Nov 06 '19 19:11 alexeystrakh

I was able to repack the package using the updated ipa-packager script and can see the SwiftSupport folder now. The source path for the original swift libs is correct now and the script can find them, copy to the SwiftSupport folder and repack the .ipa. The app can be uploaded now, but, unfortunately, the package is still rejected:

ERROR ITMS-90700: "Incorrect Platform. You included arm64 executable “Xamarin.SingleView.app/Xamarin.SingleView” in your iOS bundle. Only iOS executables can be included."

ERROR ITMS-90700: "Incorrect Platform. You included arm64 executable “Xamarin.SingleView.app/Frameworks/SwiftFrameworkProxy.framework/SwiftFrameworkProxy” in your iOS bundle. Only iOS executables can be included."
swift support

I can see that the script is trying to copy signed versions of the swift dylibs to the SwiftSupport folder based on what it sees in the .app/Frameworks/ folder, and lipo tools gives that all 4 platforms are needeed:

lipo Xamarin.SingleView.app/Frameworks/libswiftObjectiveC.dylib -archs
lipo /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/iphoneos/libswiftObjectiveC.dylib -archs

armv7 armv7s arm64 arm64e

So, as a result, the script colies dylibs as-is from the Xcode folder to the SwiftSupport.iphoneos folder.

alexeystrakh avatar Nov 22 '19 02:11 alexeystrakh

Hey @alexeystrakh are you sure this issue is with the Swift libraries? The error message from Apple points to arm64e being included on SwiftFrameworkProxy. Do you have access to the source code of that library? Can you remove this arch from the build settings?

Flash3001 avatar Apr 15 '20 18:04 Flash3001