YanSte
YanSte

Reputation: 10839

Invalid Binary Or Invalid Swift Support

After I send my app for approval to the app store I get the message 'Invalid Binary' in the iTunes Connect. Then I get the following message in an email from Apple:

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.

My app is just a simple game application. No external programs are called. I have researched this message and went through and checked the following:

  1. xcode is up to date - checked in app store
  2. EMBEDDED_CONTENT_CONTAINS_SWIFT to YES or NO
  3. send with the xcode app, not the application loader
  4. did NOT build with the command line
  5. (Xcode menu -> Preferences -> Locations tab - verified that the Command Line Tools matches Xcode version.
  6. "Clean"ed the app, rebuilt and rearchived and then resent, same message
  7. The app validates through the organizer fine
  8. viewing the contents of the archive shows a SwiftSupport folder
  9. I am only using one developer account and have never logged into any other developer account I cannot find anything online that would help solve this problem.
  10. I am running OS X Yosemite 10.10.1.
  11. xcode version is 6.1.1 version 6A2008a - built, cleaned and sent with this version
  12. I have also pressed the Option key and "Cleaned Build Folder" and resent, same message

I cannot find any other reason for this online or in any forums. Any help is greatly appreciated. Thank you for your time.






SOLUTION I FIND

Edit:

(1)

One you contact Apple and you wait long time … for reset iTunes connect because this problem coming in Apple . (Apple ask to send log of this problem)

(2)

An other solution, your create an other project application on iTunes connect and upload your work, this solution work fine, is the solution for me .

(3)

An other solution, you create a new project on Xcode, copy and paste your project in this other project.... (create new provisioning profile etc..) And upload your work in the same project application on Itunes Connect.

(4)

Step (2) + step (3), create a new project in Xcode and Itunes Connect.

(5)

Create a new project with the same name bundle identifier, it works perfectly !






Upvotes: 6

Views: 4317

Answers (6)

bandejapaisa
bandejapaisa

Reputation: 26952

To be safe, all components of your app should be built with the same version of Xcode and the Swift compiler to ensure that they work together.

I think you need to do a pod clean and install. I reckon one of your swift pods was created on a old version of Xcode, you updated Xcode and then tried to do a submission to the app store.

Read the apple swift blog about binary compatibility and frameworks

You will also want to specify that your embedded content contains swift in the build settings:

EMBEDDED_CONTENT_CONTAINS_SWIFT

Enable this setting to indicate that content embedded in a target's product contains Swift code, so that the standard Swift libraries can be included in the product.

Upvotes: 1

Abhijeet
Abhijeet

Reputation: 8761

"Check your code signing. I had this error when in automatic signing. I Put my dev profile for dev and production profile for release version and error is gone." Link for the Quote

Sometimes this happens inadvertently.

Upvotes: 1

Daij-Djan
Daij-Djan

Reputation: 50089

well xcode 6.1 is a bit old and contains old swift. xcode 6.4 is the newest public one IIRC

Upvotes: 1

David Glance
David Glance

Reputation: 649

If you are submitting an app that has an AppleWatch extension, you can get this error if you try and submit the app using the Application Loader utility and a zip file. I got the error:

The bundle contains an invalid implementation of Swift. and The bundle contains an invalid implementation of WatchKit.

I went through pretty much every solution for the first of the errors - but it was submitting via Xcode that fixed it.

Upvotes: 2

user3302800
user3302800

Reputation: 222

I ran into this problem the other day. Took some doing, but I finally figured out the problem ( for me at least). Everything I read online said the problem had to do with this setting:

EMBEDDED_CONTENT_CONTAINS_SWIFT

When this started failing, I had this set to NO. So I tried setting it to YES, and it still failed for the same reason. The GUI wouldn't let me remove this setting, I could only change it between YES and NO.

For what it's worth, my code has no EMBEDDED code, it's all just straight up SWIFT.

Anyway, so I decided to uninstall XCode and redownload it, hoping that would help.

While XCode was downloading, I fired up Beyond Compare, and compared my current project, with a backup from last week, to see what could have changed.

Beyond Compare found that a file deep inside the Projectname.xcodeproj file, changed ... a file called project.pbxproj file.

Inside this, was that line:

EMBEDDED_CONTENT_CONTAINS_SWIFT = NO;

This appeared in the current version of my project (that was failing). Interestingly enough, this line didn't exist at ALL in the old backup version from a week ago. I know that I didn't set this flag. There must have been something in Xcode that did it under the covers.

Anyway with that knowledge, Xcode finished downloading, and I reinstalled. Started it up, opened my project, and magically, Xcode REMOVED that line from the .pbxproj file, and now my project uploaded to itunesConnect sucessfully.

BottomLine: There's a bug in xcode that it may decide to add this line to your project for no reason, making your project invalid.

Solution: Editing the pbxproj file yourself and removing that line might work ... but reinstalling XCode seemed to clear up any confusion it had, and it removed it for me.

Upvotes: 2

zaph
zaph

Reputation: 112857

See: Technical Q&A QA1881 Embedding Content with Swift in Objective-C.

It seems that you only need to set EMBEDDED_CONTENT_CONTAINS_SWIFT to YES "If you are building an app that does not use Swift but embeds content such as a framework that does".

What language is your app written in? If Swift yo do not need EMBEDDED_CONTENT_CONTAINS_SWIFT.

Upvotes: 2

Related Questions