java.lang.SecurityException: Permission Denial ... requires android.permission.X
The app called an API that needs a permission it hasn’t declared or the user hasn’t granted at runtime.
Seen on:
Android
Meaning
Dangerous permissions (camera, location, notifications on Android 13+, Bluetooth on 12+) must be declared in the manifest and requested at runtime. Some APIs need special permissions or exported components.
Common causes
- Permission missing from the manifest
- Runtime permission not requested/granted
- New permission required on newer Android (POST_NOTIFICATIONS, BLUETOOTH_CONNECT)
- Accessing another app’s non-exported component
⚡ Quick fix
- Declare the permission and request it at runtime
- Check SDK-specific permissions for the target API
- Handle denial gracefully
Detailed fix by platform
Kotlin
- kotlin
val launcher = registerForActivityResult(ActivityResultContracts.RequestPermission()) { granted -> if (granted) startCamera() } launcher.launch(Manifest.permission.CAMERA)
How to diagnose
- Permission — Which one is named?
- Manifest — Declared?
- Runtime — Granted (adb shell dumpsys package)?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in Android
Other ways to find it
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 7 Oct 2026