AMFI - framework has entitlements but is not a main binary

Hello, we have a universal app that runs on iOS and iPadOS today but we're having an issue where it crashes on launch on visionOS.

When I try to run our app, I see messages like these in the console logs:

AMFI: constraint violation /private/var/containers/Bundle/Application/***/***.app/Frameworks/***.framework/*** has entitlements but is not a main binary

I see these for what seems to be all of our internal frameworks, we use cocoapods for all of these.

The following output is from running: codesign -d --entitlements :- ***.framework

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "https://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict></dict></plist>

Why would this cause a crash on launch for visionOS, but not iOS or iPadOS?

Why does AMFI think there are entitlements for the framework when they are empty?

Replies

Are you sure your frameworks don’t have entitlements? Build processes can be quite complex, and it’s common for such complexities to introduce problems like this.

Are you seeing the problem when you choose Product > Run from Xcode? If so, do this:

  1. Choose Product > Run to reproduce the issue.

  2. Choose Product > Show Build Folder in Finder.

  3. Navigate to Products > Debug-xros.

  4. Open a Terminal window for that directory.

  5. Run the following command against your framework:

% codesign -d --entitlements - Your.app/Frameworks/Your.framework

IMPORTANT Don’t run it against the framework in the Debug-xros directory; run it against the framework embedded within your app. That’s the one that visionOS cares about.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Thanks for the reply. We're not building against xros specifically, we are just enabling our existing iPad app to be available on the visionOS app store (compatible app only for now).

I took a release build from our CI, unzipped the ipa and picked one example framework to run codesign -d --entitlements - ***.framework

and the output looks like:

Executable=/Users/***/Downloads/asdf/Payload/***.app/Frameworks/***.framework/***
[Dict]

So it appears that there is just an empty dictionary for the entitlements. Should there just be no entitlements at all, or is the empty dictionary normal?