Thrown when a security manager check fails.
Questions tagged [android-securityexception]
168 questions
51
votes
12 answers
Android: Permission Denial: starting Intent with revoked permission android.permission.CAMERA
I'm trying to start a ACTION_IMAGE_CAPTURE activity in order to take a picture in my app and I'm getting the error in the subject.
Stacktrace:
FATAL EXCEPTION: main
Process: il.ac.shenkar.david.todolistex2, PID: 3293
java.lang.SecurityException:…

David Faizulaev
- 4,651
- 21
- 74
- 124
45
votes
5 answers
Getting 'No active admin' SecurityException in Android 10 - how to resolve?
I am encountering an error in the pre-launch report on the Google Play Console during testing. The error message is as follows:
java.lang.SecurityException: No active admin…

Rohan Hazarika
- 451
- 1
- 2
- 4
28
votes
1 answer
java.lang.SecurityException: MODE_WORLD_READABLE no longer supported
The exception only occurs in Android 7.0 Nougat (emulator) devices.
java.lang.SecurityException: MODE_WORLD_READABLE no longer supported
My code:
public void SessionMaintainence(Context context) {
this.context = context;
preferences =…

Abdul Gaffar
- 581
- 2
- 7
- 16
28
votes
2 answers
Why NotificationManagerCompat::cancelAll() gets SecurityException?
Using NotificationManagerCompat to cancel all notification.
NotificationManagerCompat manager =
NotificationManagerCompat.from(ctx.getApplicationContext());
manager.cancelAll();
It got exception some time (most time works).
on Andoid…

lannyf
- 9,865
- 12
- 70
- 152
13
votes
3 answers
How would a thread created by an app be considered a different app from the app's ContentProvider?
I have an app that, when notified by a ContentObserver of a change to a ContentProvider, attempts to query the provider on a background thread. This causes an SecurityException to be thrown:
8-10 15:54:29.577 …

Julian A.
- 10,928
- 16
- 67
- 107
11
votes
2 answers
Android 9.0 NotificationManager.notify() throwing java.lang.SecurityException
I have been unable to reproduce this problem myself, but so far 5 users have reported it. I did recently publish an app update that changed the target SDK from 27 to 28 which I sure plays a part in this. All 5 users are running some flavor Android…

kencorbin
- 1,958
- 1
- 20
- 18
10
votes
3 answers
Android SecurityException: Admin does not own the profile
I have a device manager application and I am trying to use setScreenCaptureDisabled(..) function of DevicePolicyManager class available since API 21.
DevicePolicyManager pManager = (android.app.admin.DevicePolicyManager)…

lyc001
- 777
- 1
- 10
- 25
9
votes
2 answers
java.lang.SecurityException: Permission Denial: opening provider com.android.providers.media.Media
I am getting-
java.lang.SecurityException: Permission Denial: opening provider com.android.providers.media.MediaDocumentsProvider from ProcessRecord{f1d408f 5594:firebasejobscheduler.test.com.firbasejobschedulerdemo/u0a1227} (pid=5594, uid=11227)…

Android Developer
- 9,157
- 18
- 82
- 139
8
votes
0 answers
how to start android-TREBLE compatible vendor java service from /vendor/app
In my Android-O device, below two background services communicating each other though AIDL.
Native/c++ android service
Starts through init rc
Runs with system linux-user
Deployed in /system partition, eg, /system/bin/nat binary.
Java Service from…

Balamurugan A
- 1,886
- 2
- 17
- 19
8
votes
1 answer
Security exception: Unable to start service. User 0 is restricted
I've got the below exception trace.
Fatal Exception: java.lang.RuntimeException: Unable to create application com.myapp.MyApplication: java.lang.SecurityException: Unable to start service Intent { cmp=com.myapp/.background.MyService }: Unable to…

dev1993
- 231
- 3
- 17
7
votes
0 answers
Permission denial -> requires oppo.permission.OPPO_COMPONENT_SAFE but it's already on the AndroidManifest.xml
I can't open intents in oppo devices.
I've put required permissions on manifest but never works... always show the same error:
java.lang.SecurityException: Permission Denial:…

Nitro Julià Soler
- 71
- 3
7
votes
1 answer
Dual apps can't access storage path /storage/emulated/999/Download/somefile.pdf
I am trying to download a file from server to Download folder of andorid
As expected it is working fine
Problem
When user clones my app (dual app) , the cloned app (2nd app) throws SecurityException: Unsupported path…

karthik kolanji
- 2,044
- 5
- 20
- 56
7
votes
2 answers
Android getActiveNotifications throws SecurityException
I have a NotificationService class that listens to notifications. However when I call getActiveNotifications(), it throws a SecurityException. Yes I have checked for permission before calling this method.
I use AsyncTask inside NotificationService…

Vajira Lasantha
- 2,435
- 3
- 23
- 39
7
votes
3 answers
Android M 6.0 - SecurityException Trying to remove accounts
I have an app that uses Android AccountManager (package name: com.mycompany.accounts), that adds accounts to the device and provides a login screen. I have another app (com.mycomp.actualapp), that uses the first app to add/remove accounts.
I can…

riggaroo
- 2,584
- 20
- 34
6
votes
2 answers
Android: java.lang.SecurityException: Package com.android.phone (uid=1001) does not match provided uid 10246
Scenario: We are sending SMS to particular number if user grantees the SMS permission.
Devices: Only Samsung devices with Android 11.
Code:
SmsManager.getSmsManagerForSubscriptionId(subscriptionId)
.sendTextMessage(destinationAddress, null,…

Hiren Patel
- 52,124
- 21
- 173
- 151