Invalid bundle structure - The app may contain only one executable file.

12,084

Solution 1

In hindsight the error is straightforward. An executable file was accidentally added to the project. In my case "Develop!.app/Xcode" meant that Xcode was the executable. Checking the list of files in the project I found a symlink to Xcode. (Maybe I dragged it from the dock somehow and dropped it into the project).

If you are getting this error look at the files in your project -- there is an executable there somewhere.

Solution 2

Invalid Build Structure

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

Your app may contain only one executable file.

This error occurs when a static library file is mistakenly copied into the app bundle.

You should link the libYourLibrary.a static library via a Link Binary with Libraries build phase.

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

Solution 3

My app was rejected with the same error message. It turned out that I was copying a third party framework (Fiksu) in the 'Copy Bundle Resources' build phase. The framework contained an executable and was already linked to in the 'Link Binary With Libraries' build phase. I deleted the framework from the 'Copy Bundle Resources' build phase. The framework continued to work normally in a release build. I resubmitted the app and it passed validation. Similar solution was posted here:

https://devforums.apple.com/message/1020254#1020254

Solution 4

I had this issue for the first time on an app I'd submitted over several versions with no issues.

I found that somehow that although I'd linked to one of my own libraries, one of the source files from that same library appeared in the list of files in the "Copy Bundle Resources" list. I have no idea how it got there but removing it meant that my app build, archived and was submitted successfully. :-)

Solution 5

If you are getting error in following format: "Invalid Bundle Structure - The binary file 'Abc.app/AnyFileName.o' is not permitted.

Build Phases > Copy Bundle Resources > check your file AnyFileName.swift will be added too here. (Remove it)

validate it with XCode. Error gone !!

Share:
12,084

Related videos on Youtube

ToddB
Author by

ToddB

Rank amateur working on first iOS app, learning the hard way. (I won't be answering too many questions). SOreadytohelp

Updated on July 04, 2022

Comments

  • ToddB
    ToddB almost 2 years

    This question is similar if not identical but there is no solution. I've looked inside the archive and there's only one executable, so I am at a loss as to how to proceed. Any ideas greatly appreciates.

    enter image description here

    enter image description here

    • ToddB
      ToddB over 10 years
      I solved it. I'll post the answer when allowed. Believe it or not, a symlink to Xcode had been copied into the bundle.
  • Sam Washburn
    Sam Washburn over 9 years
    This was my solution. Thanks.
  • Josh
    Josh over 7 years
    For XCode version 8+ this type of problem seems to cause the app submission process to actually completely crash XCode.
  • WilliamX
    WilliamX over 6 years
    This helped me figure out the problem, in my case I was adding the framework as a Linked Library AND as an Embeded binary, Removing the Embeded binary from the general tab did the trick!, thank you a lot!
  • Ronaldo Albertini
    Ronaldo Albertini about 4 years
    In my case I added to XCode project 'upload-symbols' from Firebase Library :p
  • Bugrym
    Bugrym over 3 years
    Oh man, thank you so much! I spend a few days tried figure out what's wrong.