How to fix Invalid Bundle Structure error due to executable in Resource bundle

Ingrid Silapan
2 min readJul 16, 2019

--

When submitting to App Store Connect we recently encountered an issue:

Invalid Bundle Structure. Your app can’t contain standalone executables or libraries other than a valid CFBundleExecutable of supported bundles.

Invalid Bundle Structure Error

Our framework contains a resource bundle and during the build it seems to generate two executables — one for the framework bundle and another inside the resource bundle!

At first I thought it could be because of a new update to Xcode or that it was using the New build system but after testing I’ve found this is not the case. There are two ways in which I was able to solve this issue.

Removing the executable

  1. Select your archive file > Show Package Contents. Drill down to the app file and Show Package Contents again. Locate the resource bundle and Show Package Contents.

2. Delete the binary.

You’re build should now pass validation!

Removing Build Phases

The previous method is quite tedious (manual!) and one might forget this. So I went and looked for another solution which ensures that the executable will not be generated for the resource bundle in the first place.

  1. Select the Resource bundle target > Go to Build Phases
  2. Delete Compile Sources and Link Binary with Libraries phases (which don’t actually have anything in them)

Voila, no more executable in the resource bundle and you should be good to go!

Its still quite perplexing since no build settings were changed recently and there wasn’t an extra executable being generated in the past builds so if you experience the same thing and can share your insight, let me know.

--

--