I've been struggling for a couple of days now...
I have an app that works great in AdHoc and now I'm delivering a .ipa to the customer for uploading to their private store.
I'm using XCode6.4 and Swift, and archived through xCode.
During the first attempts the app was crashing for the customer with the following log:
Library not loaded: @rpath/libswiftCore.dylib
Referenced from: /private/var/mobile/Containers/Bundle/Application/F223C4F8-4CBA-4474-9809-79D80C5AB11F/appname.app/appname
Reason: no suitable image found. Did find:
/private/var/mobile/Containers/Bundle/Application/F223C4F8-4CBA-4474-9809-79D80C5AB11F/appname.app/Frameworks/libswiftCore.dylib: code signature invalid for '/private/var/mobile/Containers/Bundle/Application/F223C4F8-4CBA-4474-9809-79D80C5AB11F/appname.app/Frameworks/libswiftCore.dylib'
Dyld Version: 353.12
After many attempts to fix this I tried to manually sign the app. When decompressing the "somename.ipa" I get a "somename" folder with 3 subfolders: Payload, SwiftSupport, Symbols. I ran: codesign --force --verbose --sign 'iPhone Distribution: certificate' appname.app/
and then: codesign --force --verbose --sign 'iPhone Distribution: certificate' appname.app/Frameworks/*
And the resulting CodeResources file looked exactly the same as before. So then I did it the other way around - signed the frameworks first and the app after that. This time I got a CodeResources file that had different hashes for the framework files and same hashes as before for the rest of the files.
Now, I zipped the "somename" folder and changed the extension from ".zip" to ".ipa". Note it still has the same structure.
Now when the customer tries to upload they get the following answer: "submission error: this build did not pass automatic validations Fatal errors: - Application directory structure should be Payload/appname.app/"
the .ipa does include that directory, I doubled and tripled checked, along with the (new) Swift top directory and the symbol files directory.
Not sure where to go with this...