Skip to content

iOS: Missing NSCameraUsageDescription causes app crash when using camera #7

@alex-pythonista

Description

@alex-pythonista

Description

The iOS app crashes immediately when attempting to access the camera functionality. This is caused by a missing NSCameraUsageDescription key in the app's Info.plist file.

Error Message

[TCC] 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.

Root Cause

iOS requires all apps that access privacy-sensitive features (camera, microphone, photo library, etc.) to declare usage descriptions in their Info.plist. These descriptions are shown to users when the system prompts for permission.

The receipt-form.tsx component at components/receipt-form.tsx:47-62 uses expo-image-picker to launch the camera via ImagePicker.launchCameraAsync(), but the required iOS permission string is not configured.

Current Configuration

Looking at app.json, the expo-image-picker plugin is not listed in the plugins array, which means the necessary iOS permission strings are not being automatically added during the native build process.

Current plugins in app.json:

"plugins": [
  "expo-router",
  ["expo-splash-screen", {...}],
  "expo-font",
  "expo-web-browser"
]

Proposed Solution

Add the expo-image-picker plugin to app.json with proper iOS permission strings:

"plugins": [
  "expo-router",
  ["expo-splash-screen", {...}],
  "expo-font",
  "expo-web-browser",
  [
    "expo-image-picker",
    {
      "photosPermission": "The app accesses your photos to let you upload receipt images for transaction extraction.",
      "cameraPermission": "The app accesses your camera to let you take photos of receipts for transaction extraction."
    }
  ]
]

After making this change, you'll need to rebuild the native iOS project:

npx expo prebuild --clean
npx expo run:ios

Impact

  • Severity: Critical (app crash)
  • Affected Feature: Receipt scanning via camera in components/receipt-form.tsx
  • Platform: iOS only

Environment

  • expo: ^53.0.6
  • expo-image-picker: ~16.1.4
  • react-native: 0.79.2

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions