Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Validation Error: 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: YES

and for the extension:

Embedded Content Contains Swift Code: NO

Xcode 8 and 9

Looks like this has been renamed to Always Embed Swift Standard Libraries in Xcode 8 and 9. So, for the app:

Always Embed Swift Standard Libraries: YES

and for the extension:

Always Embed Swift Standard Libraries: NO

The only solution that worked for me was to add this Run Script to the App Extension target:

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

enter image description here Source: https://github.com/CocoaPods/CocoaPods/issues/4203


So 3 steps to fix this from build settings

  1. Container App: Embedded Content Contains Swift Code: YES
  2. Extension: Embedded Content Contains Swift Code: NO
  3. Extension: Runpath Search Path = @executable_path/../../Frameworks

In my case, I just upgraded to CocoaPods 1.0.1 and this appears to be a new bug.

The Pod update adds a run script to my Extension's target which creates the Frameworks folder. I found it as I was about to add @Roman's run script to remove it.

Solution was to delete this script from my extension's build phase. Here is the one which needed to go...

enter image description here