Skip to content
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

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

Closed
gtm19 opened this issue May 22, 2024 · 1 comment · Fixed by #2590
Labels
bug A crash or error in behavior. macOS The issue relates to Apple macOS support.

Comments

@gtm19
Copy link
Contributor

gtm19 commented May 22, 2024

Describe the bug

If :

  • permission.camera is missing from app's pyproject.toml file, and
  • self.camera.request_permission() is called from within a toga.App instance, and
  • the app is run using briefcase run [-ur]

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

  • Operating System: MacOS Sonoma 14.4.1
  • Python version: 3.12.1
  • Software versions:
    • Briefcase: 0.3.18
    • Toga: 0.4.4

Logs

briefcase.2024_05_22-05_55_05.run.log

Additional context

No response

@gtm19 gtm19 added the bug A crash or error in behavior. label May 22, 2024
@freakboy3742 freakboy3742 added the macOS The issue relates to Apple macOS support. label May 22, 2024
@freakboy3742
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A crash or error in behavior. macOS The issue relates to Apple macOS support.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants