UIDocumentPickerViewController not working in Catalyst

I'm attemping to use UIDocumentPickerViewController, but when I run the app in development, I get an entitlements error:


[OpenSavePanels] ERROR: Unable to display save panel: your app is missing the User Selected File Read/Write app sandbox entitlement. Please ensure that your app's target capabilities include the proper entitlements.


My entitlements do incldue "User Selected File: Read/Write" in the App Sandbox section.


I'm using "Automatically manage signing" and I tried clearing out all provisioning profiles, but this doesn't seem to help.

Answered by CrunchyBagel in 404161022

I've now discovered the issue:


My Catalyst app uses a separate .entitlements file to the iOS app, since it could not unavailable entitlements (e.g. HealthKit).


However, when editing the entitlements through the Xcode visual editor, it was making changes to the iOS file.


In this case, it is kind of an Xcode bug, in that it doesn't detect the separate entitlements files in the visual editor, yet requires separate entitlements file in certain cases.

Accepted Answer

I've now discovered the issue:


My Catalyst app uses a separate .entitlements file to the iOS app, since it could not unavailable entitlements (e.g. HealthKit).


However, when editing the entitlements through the Xcode visual editor, it was making changes to the iOS file.


In this case, it is kind of an Xcode bug, in that it doesn't detect the separate entitlements files in the visual editor, yet requires separate entitlements file in certain cases.

I've also met this problem Thanks 🙏

UIDocumentPickerViewController not working in Catalyst
 
 
Q