Resolving the “Invalid Bundle: Disallowed file ‘Frameworks'” Error in Xcode

Resolving the "Invalid Bundle: Disallowed file 'Frameworks'" Error in Xcode

28 February 2025 Stephan Petzl Leave a comment Xcode

When attempting to submit an app using Xcode, you may encounter the validation error indicating that your bundle contains a disallowed file named ‘Frameworks’. This issue commonly arises when using dynamic frameworks shared between an app and its extensions. This article will guide you through resolving this error effectively.

Understanding the Error

The error message typically reads: “Invalid Bundle. The bundle at … contains disallowed file ‘Frameworks’.” This can be particularly confusing if you do not explicitly have a folder named ‘Frameworks’ in your project. The error often occurs due to the use of Swift code in both the app and its extensions, requiring specific build settings to be configured.

Step-by-Step Solution

To resolve this issue, follow these steps based on the most effective and widely adopted solution:

  • For the App: Set the build setting Always Embed Swift Standard Libraries to YES.
  • For the Extension: Set the same build setting Always Embed Swift Standard Libraries to NO.

This adjustment ensures that the Swift standard libraries are only embedded in the main application bundle, not in the extension, thereby eliminating the disallowed ‘Frameworks’ directory within the extension.

Additional Considerations

If the issue persists, consider implementing a run script in the App Extension target to remove any unintended ‘Frameworks’ directory:

    
cd "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/"
if [[ -d "Frameworks" ]]; then 
    rm -fr Frameworks
fi
    
  

Integrating Automated Testing with Repeato

While resolving such build issues is crucial, ensuring your app’s functionality remains intact is equally important. This is where automated testing tools like Repeato can be beneficial. Repeato, a no-code test automation tool, allows you to create and maintain automated tests for iOS, Android, and web apps easily. Its ability to use computer vision and AI ensures that your app’s user interface is tested thoroughly without manual intervention.

Repeato supports data-driven and keyword-driven testing, allowing for comprehensive coverage of your app’s features. It also facilitates version control by saving test data in text and JSON formats. By integrating Repeato into your workflow, you can ensure that your app remains robust and reliable, even as you make necessary adjustments to resolve build issues.

For more details on how Repeato can streamline your testing process, refer to our Getting Started Guide.

Like this article? there’s more where that came from!