Unity iOS project fails Xcode validation with "Invalid Bundle. The bundle at '[app]/Frameworks/UnityFramework.framework' contains disallowed file 'Frameworks'."

I've tried this on various versions of Unity 2019.x and Xcode 11.6

  • Develop Unity project

  • Build project for iOS

  • Open Xcode for the project

  • Archive Xcode project

  • Validate archive -> Fails with "Invalid Bundle. The bundle at '[app]/Frameworks/UnityFramework.framework' contains disallowed file 'Frameworks'

There are solutions posted online about allowing/disallowing embedded Swift code. TO BE CLEAR, THIS PROJECT DOES NOT USE SWIFT CODE.

Where can I start with researching this issue?
Post not yet marked as solved Up vote post of Thompson Down vote post of Thompson
15k views
  • if you get a "Invalid Bundle. The bundle at '[app]/Frameworks/UnityFramework.framework' contains disallowed file 'Frameworks" go to https://www.youtube.com/watch?v=tcs8A4t5N68&ab_channel=ThirteeNovCodingVlog

Add a Comment

Replies

I ran into the same issue and here is what I did - please note that this is based heavily on other's research, but it worked for me:
  1. Build project to Xcode from Unity like you normally would

  2. In the project view, select the target that is your project (usually called "Unity-IPhone" from what I've seen)

  3. Click Build Phases

  4. Click that small plus sign that’s really easy to miss at the top of the build phases section of Xcode

  5. Choose New Run Script Phase

  6. Expand the newly added Run Script

  7. Paste this script in there:

Code Block cd "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Frameworks/UnityFramework.framework/"
if [[ -d "Frameworks" ]]; then
    rm -fr Frameworks
fi

That fixed my issue for disallowed frameworks.

I will say that right after that I ran into a similar issue where my submitted app was being rejected for having invalid swift support:

ITMS-90424: Invalid Swift Support - The SwiftSupport folder is empty. Rebuild your app using the current public (GM) version of Xcode and resubmit it.

After googling around on that one, it seems like the core issue there is that the build process leaves an empty SwiftSupport directory at its base (well, empty in the sense that it only contains an empty unity folder) and Apple does not like that. What I did to resolve that (again, based on what others found):
  1. Create the application Archive as you normally would - this should leave you at the Organizer window (or go Window > Organizer)

  2. Right click on your recently made Archive and Show in Finder

  3. Right click on the archive file in Finder and select Show Package Contents

  4. Delete the SwiftSupport directory

  5. Return to the Organizer window in Xcode and submit your app

I'm sure someone better versed in Xcode build processes could add another Run Script in the right place and then the manual deletion wouldn't be needed.

Anyway - since everyone else's feedback helped me I wanted to make sure I "paid it forward" to everyone else in case there are others dealing with this.
  • Aaron Anderson

  • it works!!! Thanks you a lot!!!

  • You are a legend! Thanks a lot! This was the only thing helping in Unity 2021.3!

Add a Comment
Please note that something got lost in the copy and paste on that script - it should be:
Code Block
cd "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Frameworks/UnityFramework.framework/"
if [[ -d "Frameworks" ]]; then
    rm -fr Frameworks
fi

Sorry about that.
  • Aaron Anderson

  • I did and it successfully uploaded binary to appStoreConnect but then store deleted my binary and said we couldn't find Framework folder in it. So they want Framework folder in it but in uploading phase they don't want it. I didn't understand anything about it. My Unity version is 2020.2.7f1

  • Than you so much, ONLY this worked for me Unity 2021.3.0f1 !!!

  • Thank you very much!!! it works!!!!

Add a Comment

Thank you, it works!

Thanks for the solution. Worked for me for Unity 2021.2.18f1 and Xcode 13.3. Error was Invalid Bundle. The bundle at ‘App/Frameworks/UnityFramework.framework' contains disallowed file 'Frameworks'. With error code STATE_ERROR.VALIDATION_ERROR.90206

If you don't need Swift support you can try second way, disable Swift Framework Support in External Dependency Manager.

You can do this in Accets -> External Dependency Manager -> iOS Resolver -> Settings and disable options Enabled Swift Framework Support Workaround

Thanks for the solution, it works!