Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invalid Swift Support / invalid implementation of swift

I'd like to upload an app written in swift. Application loader delivers the app successfully, but after a few minutes I get a reply by apple telling:

Invalid Swift Support - The bundle contains an invalid implementation of Swift. The app may have been built or signed with non-compliant or pre-release tools. Visit developer.apple.com for more information.

I use xCode Version 6.0.1 (6A317), Swift iOS SDK 8.0 and just build the app with xcode.

Where can I find any information on how to get a valid implementation of swift? Apple does not say anything concrete.

Thx

like image 447
Simon Meyborg Avatar asked Oct 02 '14 15:10

Simon Meyborg


6 Answers

I had a similar problem. To fix it and be able to push a build to iTunesConnect I had to do the following:

  • Set the flag EMBEDDED_CONTENT_CONTAINS_SWIFT to YES in the target settings
  • Be sure that Build Phases did not include any other weird targets
  • Logout all Apple Developper accounts from Xcode and login with just the one you want to push the app with.
  • Archive and submit the app with Xcode and NOT with Application Loader.

Why did I need to logout from all of my Apple Developper accounts?

Because Xcode does not know which account to use to upload the binary. Application Loader ask you in the beginning but then, the uploaded build isn't valid...

UPDATE:

Since Xcode 7.1 and the new versions of Swift I got the error again. The current workaround is to do the following:

  • Create an archive locally on Xcode (does not work on my CI)
  • On Organizer, export it as an AppStore build.
  • Use Application Loader to upload the binary.

After few minutes (~10) the build should be available on iTunesConnect.

like image 158
Kevin Delord Avatar answered Nov 12 '22 20:11

Kevin Delord


The problem might come from cocoapods if you are using Swift pods. To fix it, use the branch xcode7-invalid-swift-support-fix (usage). Or do it manually by editing Pods/Target Support Files/Pods/Pods-frameworks.sh and commenting the block after

 # Embed linked Swift runtime libraries

More info:

  • Pull request : http://github.com/CocoaPods/CocoaPods/pull/4221
  • Issue : http://github.com/CocoaPods/CocoaPods/issues/4188
like image 42
cl3m Avatar answered Nov 12 '22 21:11

cl3m


Solution for xcodebuild

  • create a temp folder

  • unzip ipa file to temp folder

  • create SwiftSupport folder inside temp folder
  • copy swift libs from Payload/*app/framworks to SwiftSupport folder
  • package ipa file from contains inside temp folder (we have Payload and SwiftSupport folders).

Here my shell script for add Swift libs to ipa

https://github.com/huhuvipi/VH_ipa_packger

If you existing ipa file , you just:

path/to/package_ipa.sh /path/to/ipafile

like image 14
Vinh Huynh Avatar answered Nov 12 '22 19:11

Vinh Huynh


Do you build with command line (xcodebuild)?

If so: I encountered the same problem. The problem is that the generated ipa file is invalid. It is missing the SwiftSupport folder. The folder is added by XCode when a project with Swift is built with the Xcode Gui.

The problem is described in this apple developer forum thread with a reference to an open radar ticket: https://devforums.apple.com/message/1042117#1042117

like image 12
savage7 Avatar answered Nov 12 '22 19:11

savage7


Do you have any other version of Xcode installed?

Open your latest Xcode, then go to preferences (Xcode menu -> Preferences), switch to the Locations tab and verify that the Command Line Tools matches your Xcode version.

like image 6
Antonio Avatar answered Nov 12 '22 19:11

Antonio


If you're building via xcodebuild or Xcode Server (or anything other than the Organizer window in Xcode), the IPA is missing SwiftSupport. See this discussion of the problem.

The solution is essentially to export the IPA yourself. CaveJohnson has a command to export an IPA with the correct SwiftSupport, so you can build an IPA like so:

cavejohnson xcodeGUITricks --archive-path my.xcarchive --new-ipa-path myapp.ipa
like image 3
Drew Avatar answered Nov 12 '22 21:11

Drew