I've got an iOS app which I've recently switched to Xcode 8. As part of that we switched from swift 2.2 to 2.3 (swift 3 will come later).
I've got an automated build pipeline which essentially runs xcodebuild
to produce a release binary on a dedicated build machine, and after I sorted all that out (Xcode 8's automatic code signing really screws everything up), now when I upload my app to iTunes connect, it fails with this error:
ERROR ITMS-90171: "Invalid Bundle Structure - The binary file 'MyApp.app/libswiftRemoteMirror.dylib' is not permitted. Your app can't contain standalone executables or libraries, other than the CFBundleExecutable of supported bundles. Refer to the Bundle Programming Guide at https://developer.apple.com/go/?id=bundle-structure for information on the iOS app bundle structure."
Sure enough, if I unzip the .ipa file and have a look, there's libswiftRemoteMirror.dylib
sitting there.
If I archive/export for iTunes via Xcode, then it produces an app bundle which does not have libswiftRemoteMirror.dylib
, however all other builds of my app appear to have it. Even just doing a debug build within Xcode, then looking at the output shows that libswiftRemoteMirror.dylib is sitting in my app's bundle, indicating that Xcode itself is definitely putting it there, not any part of my automated build script.
What is this file, why is it being put there, and what should I do about it? I can modify my build script to delete this file for release builds, but I'm concerned that might affect the code signing process. I'll try it anyway and see what happens, but it feels like that's not quite the right thing to be doing.
Any advice would be appreciated.
In my case I got ERROR ITMS-90171 because I am using custom frameworks.
"Invalid Bundle Structure - The binary file 'MyFramework.framework/libswiftRemoteMirror.dylib'
(I didn't get it for my application.)
I tried gym but it got stuck at xcrun. So I tried doing rm -rf libswiftRemoteMirror
in the build phrase (with a custom run-script) for every custom framework I have and interestingly I didn't break anything: it worked.
Recently started using Swift for our project and got same error.
To find a root cause, I just did 'grep -Ril "libswiftRemoteMirror" .' in XCode.app (I have 10.1 currently) and found ./Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/XCLanguageSupport.xcplugin/Contents/Resources/swift-stdlib-tool.xcspec file. It says:
// SWIFT_RESOURCE_DESTINATION and SWIFT_RESOURCE_LIBRARY allow us to copy // libswiftRemoteMirror.dylib into place so that memory debugging tools have access to it // on device. // We disable these options in "DEPLOYMENT" modes, so that the libswiftRemoteMirror.dylib // does not make its way into archives submitted to the App Store.
So solution is simple - in XCode target settings set Deployment Postprocessing to Yes for your Release configuration (or whatever you use for build)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With