Encountering a Validation Error: Invalid Bundle. The bundle at … contains disallowed file ‘Frameworks’ can be one of the most frustrating hurdles for iOS developers. Just when you think your application is polished and ready for the world, App Store Connect throws this cryptic message, halting your submission process. This error typically indicates that your app bundle, during the validation or submission phase, includes a framework that isn’t structured correctly or is placed in an unexpected location. It’s a signal from Apple’s validation system that something within your compiled application package doesn’t meet their stringent guidelines for distribution, often related to how embedded frameworks are handled during the build process. Understanding the root causes and implementing precise solutions is crucial to overcome this roadblock and get your app into users’ hands.
Understanding the “Disallowed Frameworks” Error
The core of the “disallowed file ‘Frameworks’” error lies in Apple’s strict bundle structure requirements for apps submitted to the App Store. When you build an iOS application, any embedded frameworks—whether they are third-party libraries, Swift packages, or custom frameworks you’ve created—must reside in a specific location within your app’s bundle: YourApp.app/Frameworks/. The validation system checks for the presence of a ‘Frameworks’ folder at the root level of your app bundle, and if it finds one that isn’t structured correctly or contains unexpected content, it flags the error.
This validation check is a critical part of ensuring app security, stability, and compliance with Apple’s sandboxing rules. An incorrectly placed or malformed framework could potentially bypass security measures, lead to unexpected behavior, or even cause app crashes. For instance, if a framework intended for a different platform (like macOS) somehow gets bundled, or if an embedded framework isn’t correctly signed or stripped of unnecessary architectures, it can trigger this specific code signing validation failure. Developers often encounter this after integrating new SDKs, migrating to new Xcode versions, or when dealing with complex multi-target projects.
According to Apple’s documentation, “All content within your app bundle must be signed correctly, and all embedded frameworks must be properly nested within the App’s ‘Frameworks’ directory. Any deviation can result in validation failures.” This emphasizes the importance of meticulous configuration of build phases, especially “Embed Frameworks” and “Copy Files” settings, to ensure that all dependencies are correctly placed and processed. This error is less about the framework itself being disallowed and more about its improper packaging or location within the final application bundle.
Common Causes and Misconfigurations
Several common scenarios can lead to the Validation Error: Invalid Bundle. The bundle at … contains disallowed file ‘Frameworks’. One frequent culprit is incorrect “Embed & Sign” settings for frameworks in Xcode’s “Build Phases.” Developers might accidentally set a framework to “Do Not Embed” or “Embed Without Signing” when it should be embedded and signed, or vice versa, leading to an improperly constructed bundle. Another common issue arises from legacy build settings or manual file additions that bypass Xcode’s intended framework embedding mechanisms.
Here are some specific misconfigurations that often trigger this error:
- Incorrect Embed Frameworks Build Phase: Sometimes, frameworks are added to the “Link Binary With Libraries” phase but not the “Embed Frameworks” phase, or they are added with the wrong “Embed” option. For dynamic frameworks, they must be embedded. Static libraries do not need embedding.
- Manually Copied Frameworks: If a framework was manually dragged into the project navigator and then copied into the app bundle via a “Copy Files” build phase (rather than the dedicated “Embed Frameworks” phase), it might end up in an incorrect location or with incorrect permissions.
- Bitcode Issues: While less common now with newer Xcode versions, conflicts with bitcode compilation for embedded frameworks could sometimes lead to validation issues. Ensuring consistent bitcode settings across your app and its frameworks is good practice.
- Old Build System Caching: Xcode’s build system can sometimes cache old configurations, leading to persistent issues even after corrections. A clean build folder or derived data deletion often resolves these.
- Third-Party Library Integration: Integrating complex third-party SDKs, especially those that include their own frameworks, can be tricky. Developers often miss specific integration steps provided by the SDK vendor, leading to misconfigurations. This is particularly true for libraries that aren’t distributed via standard package managers like CocoaPods or Swift Package Manager.
Understanding these common pitfalls is the first step toward effective troubleshooting. Each of these scenarios can result in the app’s bundle failing to meet Apple’s strict structural requirements, leading to the dreaded validation failure.
When faced with the Invalid Bundle error, a systematic approach is key. This guide will walk you through the most effective steps to identify and resolve the “disallowed file ‘Frameworks’” issue.
-
**Clean Your Build Folder and Derived Data:**This is often the simplest and most effective first step. Old build artifacts can cause perplexing issues. In Xcode, go to
Product > Clean Build Folder. For a more thorough clean, close Xcode, navigate to~/Library/Developer/Xcode/DerivedData/in Finder, and delete the folder associated with your project, or simply delete all contents withinDerivedData. Then, reopen Xcode and try archiving again. -
**Verify Framework Embedding Settings:**Go to your project target’s “Build Phases” tab. Look for the “Embed Frameworks” phase. Ensure that all dynamic frameworks (those that are not static libraries) you intend to ship with your app are listed here and set to “Embed & Sign.” If you don’t see this phase, you might need to add it by clicking the “+” button and selecting “New Embed Frameworks Build Phase.” Conversely, ensure static libraries are NOT in this phase.
-
**Inspect “Link Binary With Libraries”:**In “Build Phases,” check the “Link Binary With Libraries” section. All frameworks, both static and dynamic, should be listed here. Ensure their “Status” is set to “Required.” This step confirms that your app knows about and links against these frameworks.
-
**Check “Copy Files” Build Phases:**Sometimes, developers inadvertently add frameworks to a “Copy Files” build phase, targeting a destination like “Frameworks.” While seemingly logical, this can conflict with Xcode’s default “Embed Frameworks” phase, leading to duplicate or improperly placed frameworks. Ensure no frameworks are being copied via this method if they are already handled by “Embed Frameworks.”
-
**Review Framework Search Paths:**Under “Build Settings,” search for “Framework Search Paths” and “Library Search Paths.” Ensure these paths correctly point to where your frameworks are located. Incorrect paths can lead to linking errors or prevent frameworks from being found during the build process, potentially causing an incomplete or malformed bundle.
-
**Validate Bitcode (if applicable):**For apps that still use bitcode, ensure consistency. Go to “Build Settings” and search for “Enable Bitcode.” Make sure this setting is consistent across your app target and all embedded frameworks. While Apple has made bitcode optional, conflicts can still arise if some components are compiled with it and others are not.
-
**Re-integrate Problematic Frameworks:**If the error persists and you’ve recently integrated a new framework, consider removing it entirely and re-integrating it following the provider’s specific instructions. This is especially true for frameworks integrated manually or via non-standard methods. Double-check their official documentation for any nuances regarding [](<https://stackoverflow.com/questions/3 Question & Answer :
I’m trying to submit an app with the Xcode 6 GM, and I get this error on validation. The app has an action extension and a dynamic framework that’s shared between the extension and the app itself.
I don’t have a file called ‘Frameworks’ anywhere in the project, so I’m really not sure what this is supposed to mean. Has anyone gotten this issue or have any ideas?
<img src=>)
Archive validation failed due to the issues listed below.
iTunes Store operation failed.
Invalid Bundle. The bundle at … contains disallowed file ‘Frameworks’.Turns out the error is related to using Swift (both the app and the extension make use of Swift).
For the app, I had to set:
Embedded Content Contains Swift Code: YESand for the extension:
Embedded Content Contains Swift Code: NOXcode 8 and 9
Looks like this has been renamed to
Always Embed Swift Standard Librariesin Xcode 8 and 9. So, for the app:Always Embed Swift Standard Libraries: YESand for the extension:
Always Embed Swift Standard Libraries: NO