# PlatformException(camera_error, Camera access denied, null, null)

- **ID:** `flutter/platform-exception-camera-permission`
- **Domain:** flutter
- **Category:** auth_error
- **Error Code:** `camera_error`
- **Verification:** ai_generated
- **Fix Rate:** 90%

## Root Cause

The app attempted to access the camera on iOS or Android without the required runtime permission being granted by the user.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| flutter 3.10 | active | — | — |
| flutter 3.22 | active | — | — |
| camera 0.10.5 | active | — | — |
| permission_handler 11.0.0 | active | — | — |

## Workarounds

1. **Use the permission_handler package to request camera permission before initializing the camera. Implement a permission check flow that shows a rationale dialog if permission is permanently denied.** (92% success)
   ```
   Use the permission_handler package to request camera permission before initializing the camera. Implement a permission check flow that shows a rationale dialog if permission is permanently denied.
   ```
2. **Wrap camera initialization in a try-catch block and handle the PlatformException gracefully, showing an error message to the user.** (85% success)
   ```
   Wrap camera initialization in a try-catch block and handle the PlatformException gracefully, showing an error message to the user.
   ```

## Dead Ends

- **Adding only the Android permission in AndroidManifest.xml without requesting runtime permission** — On Android 6.0+ and iOS 10+, runtime permission prompt is required; manifest declaration alone is insufficient. (95% fail)
- **Calling camera plugin directly without checking permission status first** — The plugin throws the exception immediately if permission is denied; no fallback handling is provided. (80% fail)
