8

I have tried do submit an application via Xcode (as well as the application loader) to the Apple store, and I received the following error:

Invalid Bundle Structure - The binary file 'xx.app/xx' is not permitted. Your app may contain only one executable file. Refer to the Bundle Programming Guide for information on the iOS app bundle structure.

I checked the files generated files/project settings and I didn't find what's wrong according to the Bundle Programming Guide.

We have attempted to clean our code repository, as well as do clean builds by updated the build folder locations as well as the derived data locations and still get the same error.

The only feedback that Apple has given us is a query about whether we use 3rd party libraries, which we do. This has only happened as of a few days ago.

Any suggestions or step by step instructions to get our binaries uploaded would be greatly appreciated.

We are using Version 4.6.2 (4H1003) as well as Application Loader 2.8 to upload to iTunes, and we have deployed multiple apps with the exact same structure previously (last app was deployed 2 days prior to the error occuring, and now attempting to reupload the last working binary to an alternate app [after changing relevant app specific info] fails).

Thanks in advance.

pkamb
  • 33,281
  • 23
  • 160
  • 191
user2359229
  • 81
  • 1
  • 3
  • Hard to say, never ran into this before. Is your CFBundleVersion value larger than the previously uploaded version? – ahwulf May 07 '13 at 17:14
  • The obvious question, as implied by the error message, is *does the bundle have more than one executable file?* It's telling you what it thinks is wrong, have you checked on that? If so, what did you find? – Tom Harrington May 07 '13 at 17:34
  • Just to add to what @TomHarrington said, you can look directly into your app package (xx.app, or the archive you've saved) to see what's going on. Just keep drilling down in the Finder, using Show Package Contents where necessary. – matt May 07 '13 at 18:09
  • Yip, we have verified the bundle, and only one executable exists. Will verify the CFBundleVersion, to see if that may be a problem. – user2359229 May 07 '13 at 18:43
  • @ahwulf, regarding the CFBundleVersion, the apps we are deploying are new apps, not updates, so that shouldn't be a problem. – user2359229 May 07 '13 at 19:09
  • I wonder if there is only one exectuable, but something else has a wrong permission or filetype and the bundle checker thinks its a real executable. No clue how that could happen though. Do you have any script phases in the build? – ahwulf May 08 '13 at 13:10
  • Or perhaps there is more than a file with executable bit set. – nalply May 10 '13 at 18:48

7 Answers7

8

For me the answer was to

  1. go to

    /Users/myusername/Library/Developer/Xcode/Archives

  2. go to the current folder for the latest archive.

  3. right-click the .xarchive and select 'show package contents'

  4. navigate inside the 'products/applications' directory

  5. right-click the myAppName.app and select 'show package contents'

  6. delete the exe at the very bottom that was not named myAppName.exe

user1709076
  • 2,538
  • 9
  • 38
  • 59
  • Somehow one of my object files got in there; I deleted it (after archiving, but before submitting/validating), and that cleared the warning. – Rayfleck Sep 17 '15 at 22:10
  • Did the trick, Idk from where this 2nd executable was being created but anyways saved me from further wasting more time. Thanks a bunch – Ahsan Ebrahim Khatri Jun 10 '17 at 09:29
4

Some developers have hit this issue when integrating the Apptentive iOS SDK. Making the same error with other 3rd-party SDKS will cause the same issue.

Invalid Build Structure

The binary file 'YourApp.app/libApptentiveConnect.a' is not permitted.

Your app may contain only one executable file.

This error occurs when the Apptentive static library is copied to the app bundle.

libApptentiveConnect.a should be added to the target's Link Binary with Libraries build phase.

It should not be added to the target's Copy Bundle Resources build phase.

pkamb
  • 33,281
  • 23
  • 160
  • 191
3

I know this is a rather old post, but I ran into this issue and this is how I fixed it:

  1. In Xcode, click on your project and go to the target's build settings.
  2. Make sure the "Build Variants" setting ONLY has "normal" set for the target.
  3. Clean and rebuild.

I believe this is what fixed the problem, but there is one other change that may have had an effect.

At one point, I had turned off 'Parallelize Build" in my active Scheme. I had since turned it back on, but perhaps it left some artifacts. I doubt this had any connection, but just in case, I went to my build folders and deleted the files inside before I cleaned and built.

I hope this can help someone who runs into this issue.

Christine
  • 640
  • 4
  • 9
1

I had put my NSBundle.m in Copy bundle resources - don't do that :(

Lyck
  • 691
  • 1
  • 6
  • 18
0

I ran into this as well. In my case a symlink to a binary (Xcode) had been added to the project (somehow). Removing from the project was the fix.

ToddB
  • 2,490
  • 3
  • 23
  • 40
0

see screen shot, this is the right side of xcode, where it says "text Encoding", 4 of my header files and objective C files where called something like "regular text files" instead of "Unicode (UTF-8), how they got that way, I don't know, but xCode decided to make them into binaries ".o" files, and even put them in where the pngs go in an archived project.

enter image description here

hokkuk
  • 675
  • 5
  • 21
-2

I had this problem, tried all of the solutions above and didn't work for me. In the end it was solved by creating the app in iTunesConnect ( itunesconnnect.apple.com ).

  • What do you mean by creating an app in iTunesConnect? – Jayprakash Dubey Jan 15 '17 at 07:57
  • Sorry - that might have come across as unclear. Log on to itunesconnect.apple.com - go to my apps - hit the + in the top left corner and add your app details. In my case I had not completed this step and it fixed the problem mentioned above. – Maron Kristofersson Jan 28 '17 at 12:57