SecurityException: permission denied
Error text
java.lang.SecurityException: Permission Denial: opening provider ... requires android.permission.READ_MEDIA_IMAGES SecurityException: Neither user 10123 nor current process has android.permission.CAMERA
Cause
The code calls an operation that needs a permission, but either the manifest lacks it or the user did not grant it at runtime.
Step-by-step fix
- Check that the
<uses-permission>line is inAndroidManifest.xml. - Dangerous permissions (camera, location, microphone) must be asked at runtime with
requestPermissionsor the Activity Result API. - On Android 13+ use new permissions such as
READ_MEDIA_IMAGESinstead ofREAD_EXTERNAL_STORAGE. - If denied, the app must not crash; it should show an explanation.
- For testing, grant with
adb shell pm grantor reset withpm reset-permissions.
Example commands
adb shell pm grant com.example.app android.permission.CAMERA adb shell dumpsys package com.example.app | grep -A3 "granted=false" adb shell pm reset-permissions
How to prevent it
Ask for each permission right before first use, with an explanation.
Author and license: Nibras Code
- APK will not install
- What is a parse error?
- The keystore is lost
- The signatures do not match
- Package name error
- The APK file is damaged
- Play Protect blocks the app
- The package appears to be invalid
- Not enough storage
- The phone is not compatible
- An older version will not install
- XAPK will not install
- Gradle sync failed
- Could not resolve a dependency
- Duplicate class error
- Manifest merger failed
- Dex limit: 65536 methods
- R8: Missing class
- JDK version mismatch
- SDK location not found
- minSdkVersion conflict
- compileSdk is too low
- EAS build: Gradle failure
- expo prebuild error
- Metro: Unable to resolve module
- Hermes: JS error only in release
- White screen in release
- Red screen: cannot reach Metro
- Expo SDK mismatch
- Capacitor sync error
- Capacitor: white screen
- EAS: keystore and credentials error
- Keystore was tampered with / wrong password
- Wrong key alias or password
- Play: signed with the wrong key
- INSTALL_FAILED_UPDATE_INCOMPATIBLE
- INSTALL_FAILED_VERSION_DOWNGRADE
- INSTALL_FAILED_INSUFFICIENT_STORAGE
- INSTALL_FAILED_NO_MATCHING_ABIS
- Parse error (problem parsing the package)
- "App not installed" error
- Installing an AAB file on a phone
- adb: device "unauthorized"
- adb: device not found
- adb server version mismatch
- Activity class does not exist
- Play: targetSdk level too low
- Play: permissions policy rejection
- Play: 64-bit requirement
- Play: versionCode already used
- ClassNotFound / NoSuchMethod crash
- OutOfMemoryError crash
- CLEARTEXT communication not permitted