Reputation: 4319
I just re-wrote an app in Swift 2. I'm trying to upload the app to iTunesConnect (via Xcode 7 GM) for internal testing.
I wrestled with an "Invalid Swift Support" error for awhile (which has other, related questions) ... but now it's changed to something a little different.
The error from Apple now says:
Invalid Swift Support
The files libswiftCoreLocation.dylib, libswiftCoreMedia.dylib, libswiftCoreData.dylib, libswiftAVFoundation.dylib don’t match
/Payload/App.app/Frameworks/libswiftCoreLocation.dylib, /Payload/App.app/Frameworks/libswiftCoreMedia.dylib, /Payload/App.app/Frameworks/libswiftCoreData.dylib, /Payload/App.app/Frameworks/libswiftAVFoundation.dylib
Make sure the files are correct (?), rebuild your app, and resubmit it.
Don’t apply post-processing to
/Payload/App.app/Frameworks/libswiftCoreLocation.dylib, /Payload/App.app/Frameworks/libswiftCoreMedia.dylib, /Payload/App.app/Frameworks/libswiftCoreData.dylib, /Payload/App.app/Frameworks/libswiftAVFoundation.dylib.
I've been unable to find similar errors by searching for "Don’t apply post-processing", "Make sure the files are correct, rebuild your app, and resubmit it", etc.
Does anyone know how I can "Make sure the files are correct" --or-- have any other recommendations? Thank you.
Upvotes: 117
Views: 19057
Reputation: 899
I was using fastlane gym 1.9.0 to build my app and it kept getting rejected by apple because the files didn't match, whereas if i uploaded through XCode 8 it was accepted. I checked the swift libs in the ipa's swift support folder and in the Frameworks folder, I found that the libs in the swift support folder were for swift 2.3 while in the Frameworks folder it was swift 3. So in my gym file I added the toolchain option:
gym(
scheme: "CoCadre",
configuration: "Production Release",
clean: true,
use_legacy_build_api: false,
toolchain: "com.apple.dt.toolchain.Swift_2_3"
)
*Note that i had to change use_legacy_build_api to false to use the toolchain option
In order to use toolchain option, need to set use_legacy_build_api: false https://github.com/fastlane/fastlane/issues/6003#issuecomment-244792185
Upvotes: 8
Reputation: 5772
The error for me was that i built with Adhoc profile instead of App Store profile for uploading the spa to the app store.
Upvotes: 0
Reputation: 61860
sudo gem install cocoapods
in terminal.pod update
under your project's directory.Debug
option for all your pods.The problem is fixed because the following code in Pods-frameworks.sh
:
# Embed linked Swift runtime libraries
local basename
basename="$(basename "$1" | sed -E s/\\..+// && exit ${PIPESTATUS[0]})"
local swift_runtime_libs
swift_runtime_libs=$(xcrun otool -LX "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/${basename}.framework/${basename}" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
for lib in $swift_runtime_libs; do
echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
code_sign_if_enabled "${destination}/${lib}"
done
was changed to:
# Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
local swift_runtime_libs
swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
for lib in $swift_runtime_libs; do
echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
code_sign_if_enabled "${destination}/${lib}"
done
fi
Upvotes: 4
Reputation: 1789
Edit: CocoaPods 0.39.0 has been released which fixes this issue!
As @orkenstein mentioned, there is a simpler solution by commenting out some code in Pod-frameworks.sh
. I'm including a bit more details here.
In your Xcode project directory, open Pods/Target Support Files/Pods/Pods-frameworks.sh
Comment out the following lines:
# Embed linked Swift runtime libraries
local basename
basename="$(basename "$1" | sed -E s/\\..+// && exit ${PIPESTATUS[0]})"
local swift_runtime_libs
swift_runtime_libs=$(xcrun otool -LX "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/${basename}.framework/${basename}" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
for lib in $swift_runtime_libs; do
echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
code_sign_if_enabled "${destination}/${lib}"
done
=>
# Embed linked Swift runtime libraries
# local basename
# basename="$(basename "$1" | sed -E s/\\..+// && exit ${PIPESTATUS[0]})"
# local swift_runtime_libs
# swift_runtime_libs=$(xcrun otool -LX "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/${basename}.framework/${basename}" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
# for lib in $swift_runtime_libs; do
# echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
# rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
# code_sign_if_enabled "${destination}/${lib}"
# done
Save Pods-frameworks.sh
and you should be good to go!
Upvotes: 49
Reputation: 181
The fix for this issue has been merged and it is available on the latest CocoaPods version 0.39.0.beta.5
https://github.com/CocoaPods/CocoaPods/pull/4268
To get the latest version of CocoaPods run gem install cocoapods --pre
Alternatively, follow instructions for running unreleased features: http://guides.cocoapods.org/using/unreleased-features
Once you have the latest version of CocoaPods, run pod install
again.
Upvotes: 16
Reputation: 1318
My Solution for this:
I'm using Reveal through Cocoapods and Reveal needs to disable Bitcode. So I included Reveal(should work for any other Framwork) only for Debug:
pod 'Reveal-iOS-SDK', :configurations => ['Debug']
As my Reveal is now only configured for Debug, I disabled Bitcode only for Debug.
With this settings everything works fine, without any hacks...
Upvotes: 2
Reputation: 2858
There is a little less complex solution, found on GitHub:
I had a look around in Pods-frameworks.sh and found a section commented as:
Embed linked Swift runtime libraries
Commenting the block of code which copies these libraries across (and code signs them) seems to have fixed my submission woes. I've not dived in deeper yet to see if it's just the copying of them which causes the issues or if it's the code-signing. I'm getting a bit out of my depth there.
Upvotes: 6
Reputation: 996
Same problem here. I think this is most likely a bug of the Developer Tools, related to the Bitcode.
I just found the workaround for this.
Products/Applications/YourApp.ipa/Frameworks/
and SwiftSupport/iphoneos/
libswiftXxx.dylib
files from SwiftSupport/iphoneos/
into Products/Applications/YourApp.ipa/Frameworks/
and overwriteWith this process, I succeed in uploading my build. Now I’m waiting for review.
NOTE:
I’m using CocoaPods, and the ENABLE_BITCODE
option was NO.
Upvotes: 82
Reputation: 42489
I've seen this error occur when integrating libraries that do not support bitcode (such as the current stable version of New Relic). The solution is either to remove the libraries, disable bitcode (and potentially not be able to submit to the store), or wait for updated binaries that support bitcode from your library vender.
Upvotes: 0