Unity iOS app fails validation with "Invalid Bundle" error

Unity 2019.4.2f1, mobile app for iOS. Build project and send to Xcode 11.6. Project builds and installs on physical device fine, but fails archive validation with error:

“Invalid Bundle. The bundle at ‘[appname]/Frameworks/UnityFramework.framework’ contains disallowed file ‘Frameworks’.”

The only framework I am including is the Unity framework.

Apple swears that this is a Unity issue. If so, what can I do to diagnose this problem?

ETA: Apple tells me this:

The App Store expects an exact framework bundle structure. For this error, the Unity framework contains a folder named Frameworks at [appName]/Frameworks/UnityFramework.framework/Frameworks. The Frameworks folder is a reserved location for a bundle to place frameworks, but iOS does not support nesting frameworks inside of frameworks, so this folder should not exist at all.

We directed you to Unity’s support because this indicates the framework isn’t built correctly and falls outside of the expected bundle structure for iOS apps. Unity will need to provide you with an updated framework, or help you fix your configuration in their environment that caused their framework bundle to have an incorrect structure.

1 Like

Same problem for me with Unity 2019.3.10f1. Spent whole day in attempts to solve it with known internet solutions. No luck so far.

  1. In PostProcessBuild script set ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES for Game target and UnityFramework target
  • Game YES : UnityFramework NO ← recomended solution from internet
  • Game YES : UnityFramework YES
  • Game NO : UnityFramework NO
  1. Add a new Script Build Phase to Unity Framework to force delete this “Frameworks” folder
cd "$CONFIGURATION_BUILD_DIR}/UnityFramework.framework/"
rm -rf "Frameworks"

Pointless, because “Copy Swift Standard Libraries” step happens after last Build Phase, recreates this folder and add libraries anyway. Also, adding same Build Phase into Game target before copying UnityFramework in place, broke build in horrible way.

  1. Our project using Pods, so i’m checked every target in Pods project for ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES set to NO.

  2. Add @executable_path/…/…/Frameworks to Runpath Search Path

  3. Update Unity to 2019.4.5f1

  4. Update System to 10.15.6 and XCode to 11.6 (11E708)

  5. Update CocoaPods to 1.9.3

  6. Add use_framework! into UnityFramework target in Podfile

Every attempt done with Build → Clean Build Folder, Build → Archive, Organizer → Validate App

Resume: For some reason XCode insert standard libraries into UnityFramework no matter what and there is no options to control this behaviour.

OP here: are you building XR/VR/AR? I posted about this on r/Unity3D and a stranger correctly identified that I was build VR (Google Cardboard) but that was as fgar as that went. Just looking for commonalities…

No, we don’t use any kind of AR.

Here plugins/pods/services we are using:

  • Helpshift
  • Facebook SDK (Core, Login, Share)
  • Google Firebase (Analytics, Craslytics, Fabric)
  • Unity Ads

Solved. Was caused by Helpshift SDK.
Mentioned here: Troubleshooting | Helpshift Developer Guide