beeware / toga

A Python native, OS native GUI toolkit.
https://toga.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
4.19k stars 656 forks source link

App crashes without logs/error message when camera permissions are required, but required metadata not added to pyproject.toml #2589

Closed gtm19 closed 1 month ago

gtm19 commented 1 month ago

Describe the bug

If :

Then it crashes and produces no logs.

If you dig around in the 'Report' dialog generated by macOS, you get the following message:

This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSCameraUsageDescription key with a string value explaining to the user how the app uses this data

Steps to reproduce

  1. Instantiate a briefcase app
  2. Add a call to self.camera.request_permission() in a method
  3. Add the method as a callback to a button
  4. briefcase run -ur and push the button

If you run briefcase dev the app seems to work and does not warn that the permissions have not been set.

Expected behavior

A warning during development, and an error when running a bundled app, that the permission.camera metadata is missing from the pyproject.toml file

Screenshots

No response

Environment

Logs

briefcase.2024_05_22-05_55_05.run.log

Additional context

No response

freakboy3742 commented 1 month ago

I think this issue only occurs on Sonoma; I did the initial development on Ventura, and didn't have this problem, but I have since updated my laptop and can confirm that it's definitely happening now.