-
Notifications
You must be signed in to change notification settings - Fork 516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
macOS: App doesn't recognise/find NSPhotoLibraryUsageDescription in Info.plist #15614
Comments
So when I crash in the app, I can find the following in Console:
It is complaining about the missing entitlement, not the description string. And now we get to talk about a fun new development from Apple - macOS APIs that require code signing even if the documentation doesn't state it. For a number of privacy focused APIs, such as Photos, it seems your application must be both code signed AND hardened or tccd (Apple's entitlement daemon) will kill you on first access. For performance reasons we don't code sign debug macOS build by default, but for cases like this (and app extensions for another) you must be code signed. When I add this to your test project:
and this to your Entitlements file:
The photo aspect starts working for me, but it breaks debugging in VSfM :( - I will file that shortly. Try adding those @tipa and report back. |
Hi @tipa. We have added the "need-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
Thanks! I also had to add this to get it working, otherwise the app wouldn't launch.
I only get a warning now when running
Hope the VS bug will be resolved shortly so that I can finally start working with .NET6 MacOS |
So this warning:
Is saying the build is slower than it could be, because we're not handling codesigning correctly and double signing part of the build. Could you file a new issue and attach a binary build log? It's something we should fix in the future, but should be harmless for you. |
@chamons is it possible to ping the VS team internally to give this issue some priority? There hasn't been any progress at all so far. At the moment it's pretty much impossible to develop a .NET 6 macOS app that needs to be signed with Entitlements. |
I'll give them a poke, sorry for the trouble. |
Steps to Reproduce
await PHPhotoLibrary.RequestAuthorizationAsync(PHAccessLevel.ReadWrite)
to .NET6 macOS appNSPhotoLibraryUsageDescription
toInfo.plist
Expected Behavior
no crash
Actual Behavior
app crashes:
This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an com.apple.security.personal-information.photos-library key with a string value explaining to the user how the app uses this data.
Comment
This worked worked previously when using Xamarin.MacOS (instead of .NET 6 macOS)
Environment
Version information
Build Logs
buildlog.txt
Example Project (If Possible)
test.zip
The text was updated successfully, but these errors were encountered: