Thrown when a security manager check fails.
Questions tagged [android-securityexception]
168 questions
2
votes
0 answers
SecurityException when passing content URI through PendingIntent
I have an mp3 file that I am trying to pass to other apps such as email or save to Google Drive through a notification's PendingIntent with a content Uri. This worked fine pre Nougat with file Uri, but now I am trying to use a…

Steve M
- 9,296
- 11
- 49
- 98
2
votes
0 answers
Android M 6.0: cannot remove accounts : java.lang.SecurityException
On Marshmallow, i fell on this Exception when I add a google account type:
" java.lang.SecurityException: uid 10121 cannot remove accounts of
type: com.google at "
I add the accound using
mAccountManager.addAccount("com.google", null, null,…

divol
- 192
- 7
2
votes
0 answers
App gives SecurityException when trying to access already created account after App update
App(version 1), created an account using AccountManager for saving auth tokens. Everything was working fine, was able to fetch and refresh Auth tokens
Sent out an update of the App (version 2), with no changes in the AccountManager code. I can see…

himvz
- 21
- 3
2
votes
2 answers
Runtime Permission in Redmi Phone
I am trying to send sms targeted version 24 with runtime permission. It gives SecurityException in Redmi Mi 3s device but working fine on other device with Marshmallow OS.
final int REQ_CODE = 100;
void requestPermission(){
if…

Pratik
- 452
- 4
- 17
2
votes
3 answers
Permission Denial: writing android.support.v4.content.FileProvider uri
Good day.I have an weird issue to which none of examples in stack overflow has worked.I am opening an gallery,after which i am redirecting user to crop intent.Important to mention that this only happens on android N and not below devices.The issue…

fasf safsaf
- 31
- 1
- 5
2
votes
1 answer
java.lang.SecurityException: caller uid XXXXX lacks any of android.permission.GET_ACCOUNTS
Note: This is not a duplicate, I tried a lot of solutions in similar StackOverflow questions and they didn't work in my case. Thank you for any help.
This crash appears to only happen on devices running an Android version older than 6.0. For…

Rock Lee
- 9,146
- 10
- 55
- 88
2
votes
2 answers
Collections.sort causing java.lang.SecurityException: Requires READ_PHONE_STATE
I am getting the crash below at this code line:
pkgMrg_global = getActivity().getPackageManager();
apps = pkgMrg_global.getInstalledApplications(0);
//GETTING CRASH AT LINE BELOW
Collections.sort(apps,
new…

user1406716
- 9,565
- 22
- 96
- 151
2
votes
0 answers
Security exception in binding service in android from an activity in separate app mentioning permission denial
I have developed a bounded service app in android to get data from a Glucose meter device over USB serial port.I have developed another activity in a different app from where I am launching the service to get data in the activity screen.
I am…

Samrat
- 161
- 2
- 16
2
votes
1 answer
SecurityException while broadcasting protected intents
I'm working on an app that should be able to broadcast protected intents like android.intent.action.DEVICE_STORAGE_LOWso that I can see if the necessary system receivers work properly. Currently the app stops and I get a security exception.
Is…

Jayaram
- 21
- 1
- 2
2
votes
1 answer
throws SecurityException when signing with the default debug keystore
I am receiving a SecurityException since yesterday when I launch the service using signature protection level for permission with the default debug keystore. The strange thing is I wasn't receiving this error before yesterday and I didn't make any…

Ömer
- 1,666
- 2
- 18
- 33
1
vote
0 answers
SecurityException open data intent from Gmail attachment
I am getting this error:
java.lang.SecurityException: Permission Denial: reading com.google.android.gm.sapi.SapiUiProvider uri…

user3092292
- 49
- 2
- 2
- 9
1
vote
0 answers
Get android device name (not model name) where SDK version is greater than 31
I displayed the bluetooth name as the device name in my application in the following way:
public static String getDeviceName(ContentResolver contentResolver) {
String userDeviceName = Settings.Secure.getString(contentResolver,…

ganjaam
- 1,030
- 3
- 17
- 29
1
vote
1 answer
Android 13 FileProvider: Unable to access file descriptor from URI despite granting temporary permissions
For some time we have been using the FileProvider APIs to reading/writing a file in App A's internal data directory (/data/data/app.a.package/files/someFile) from App B using a BroadcastReceiver. Here is a flow of the communication between the…

jimmy_sprinkles
- 31
- 5
1
vote
1 answer
java.lang.SecurityException: Need android.permission.BLUETOOTH_SCAN permission for android.content.AttributionSource
I have been trying to build an Android App with the capability of connecting to
a bluetooth device called ESP32 on BLE mode. I have found some posts helping me in these
regards but I also have to debug lots of stuff. I ask runtime permissions on…

SeikoFPS
- 13
- 3
1
vote
1 answer
Stored image URI for later use, but it throws SecurityException
In the SecondActivity, it has an ImageViewand a Button
public class SecondActivity extends AppCompatActivity
{
private ImageView galleryImage;
@Override
protected void onCreate(Bundle savedInstanceState)
{
…

Alex Cai
- 35
- 4