36

I am having an issue with sqlite db in Android. But as I made a quick research on the internet, I suspect that the problem is not related to sqlite but system user. My app is not recognized as authorized user to access db functionalities. I tried to apply possible suggested solutions in stack overflow but none of them made a difference. This is the LogCat I am facing every time I attempt to use db functionality.

12-14 02:35:17.721    2953-3355/? E/DatabaseUtils﹕ Writing exception to parcel
java.lang.SecurityException: Permission Denial: get/set setting for user asks to run as user -2 but is calling from user 0; this requires android.permission.INTERACT_ACROSS_USERS_FULL
at com.android.server.am.ActivityManagerService.handleIncomingUser(ActivityManagerService.java:13082)
at android.app.ActivityManager.handleIncomingUser(ActivityManager.java:2038)
at com.android.providers.settings.SettingsProvider.callFromPackage(SettingsProvider.java:577)
at android.content.ContentProvider$Transport.call(ContentProvider.java:279)
at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:273)
at android.os.Binder.execTransact(Binder.java:388)
at dalvik.system.NativeStart.run(Native Method)

I tried to add permission

android.permission.INTERACT_ACROSS_USERS_FULL

but still no sound. The strange thing is when I try to add INTERNET permission Android Studio 0.3 (ide I use) suggests me possible permissions I can choose. But when it comes to INTERACT_ACROSS_USERS_FULL permission it behaves like it has no idea about this permission. My test device is Samsung S4 running on 4.3.

I assume that I am not the only one who tries to use db on android. So there is a solution.

How can I really add INTERACT_ACROSS_USERS_FULL permission to my application?

8
  • stackoverflow.com/questions/19756727/…
    – 5er
    Dec 14, 2013 at 1:03
  • Ok, I saw this post a few times. But what does it mean? How can I give my app same signature as system?
    – gurkan
    Dec 14, 2013 at 1:13
  • You would have to either be the creator or they system, or convince them to sign your app - neither of which is realistic for most developers, ie, you can't. It really sounds like you are doing something unnecessarily odd. Have you tried to build a simple database example, dating from the days before multiuser support? Dec 14, 2013 at 2:55
  • 1
    Thank you for your attention. I realized that the problem is not related to multiuser problem. Database operations work now. But this error keeps showing. It does not affect functionality at present but I wonder it becomes a problem later.
    – gurkan
    Dec 14, 2013 at 11:26
  • Any solutions so far? Feb 10, 2014 at 12:41

5 Answers 5

20

According to this answer: android.permission.INTERACT_ACROSS_USERS_FULL is a signature level permission. Your app will not be able to use it until and unless it has the same signature as the system.

Which is not something you can achieve unless you either are the creator or the system build, or collaborating with them such that they are willing to sign your apk with their certificate. In other words, this is off limits for most developers.

5
  • 12
    Do I add this permission or not, why such a complex response ?
    – Siddharth
    May 21, 2014 at 15:08
  • As the answer mentions, we cannot add this permission to our Android Manifest file unless your app is able to access system level signatures on your device. In other words (a.f.a.i.k.), this feature can only be used by the device OEMs.
    – SamSPICA
    May 22, 2014 at 5:03
  • 2
    On a Samsung Device I get a exception if I dont use this. On a non samsung if I use it I get a exception. What do I do in this cae ?
    – Siddharth
    May 22, 2014 at 6:57
  • 6
    @Siddharth: Yes, the issue is mostly consistent on Samsung devices (S3, particularly). This is usually just an exception, and does not affect the flow of your processes, so you may just ignore it. It seems to have been solved in S4. I'm not sure what can be done, if this is causing something to break in your app.
    – SamSPICA
    May 23, 2014 at 5:06
  • 1
    I think you are right. I'll just let it be for now.
    – Siddharth
    May 23, 2014 at 5:37
5

I got the error android.permission.INTERACT_ACROSS_USERS_FULL because I had some conflicts in the bin directory of the project. I did some changes to the my app package id and the app-file-1.apk in the bin directory doesn't match with the project.

I did a project > clean and checked that the bin folder was cleared and regenerated, and it works now.

1
  • 1
    Thank you, I was having this error on an updated Xamarin install and this really helped.
    – WickedW
    Aug 10, 2015 at 18:15
0

I had the same issue and think that I can help you out. I had registered my app with my production keystore, but was using Eclipse debug to load it into my phone. The Eclipse debug uses debug.keystore which wont match the signature of your production key and throw this error. Use the debug keystore instead for testing or send the apk to yourself and download it onto your phone.

0

I get this error when I change my minSdkVersion from 8 to 11 in my Manifest. I changed it back to 8 or 9 and no more error.

Try changing your minSdkVersion in your manifest. I was able to repeat the crash and error results with versions 10, 11, and 12 (my app crashes and displays "requires android.permission.INTERACT_ACROSS_USERS_FULL" in the LogCat)

0

Try to disable auto-fill. It works 100% on Android Oreo. Check this link

Simply add this code to your app :

      if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
        window.decorView.importantForAutofill = 
        View.IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS;
    }
2
  • How is this an answer to the question?
    – laalto
    Mar 30, 2018 at 11:55
  • I didn't remember where I read this, but it works for me. So, it may be one of the possible solutions Mar 30, 2018 at 11:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.