1

This is a rather strange problem that I am facing. I have an app that parses a JSON file to get some URLs. This file is stored in the assets folder. Now, when I run the unsigned app from Eclipse, the app behaves as expected; the display is fine and all.

The PlayStore version has issues. When I try to run the PlayStore's app, I get this:

08-17 22:03:38.932: E/DatabaseUtils(2350): Writing exception to parcel
08-17 22:03:38.932: E/DatabaseUtils(2350): 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
08-17 22:03:38.932: E/DatabaseUtils(2350):  at com.android.server.am.ActivityManagerService.handleIncomingUser(ActivityManagerService.java:13140)
08-17 22:03:38.932: E/DatabaseUtils(2350):  at android.app.ActivityManager.handleIncomingUser(ActivityManager.java:2038)
08-17 22:03:38.932: E/DatabaseUtils(2350):  at com.android.providers.settings.SettingsProvider.callFromPackage(SettingsProvider.java:607)
08-17 22:03:38.932: E/DatabaseUtils(2350):  at android.content.ContentProvider$Transport.call(ContentProvider.java:279)
08-17 22:03:38.932: E/DatabaseUtils(2350):  at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:273)
08-17 22:03:38.932: E/DatabaseUtils(2350):  at android.os.Binder.execTransact(Binder.java:388)
08-17 22:03:38.932: E/DatabaseUtils(2350):  at dalvik.system.NativeStart.run(Native Method)
08-17 22:03:38.992: E/SystemClock(2711): File Open Failed
08-17 22:03:40.954: E/DatabaseUtils(2350): Writing exception to parcel
08-17 22:03:40.954: E/DatabaseUtils(2350): 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
08-17 22:03:40.954: E/DatabaseUtils(2350):  at com.android.server.am.ActivityManagerService.handleIncomingUser(ActivityManagerService.java:13140)
08-17 22:03:40.954: E/DatabaseUtils(2350):  at android.app.ActivityManager.handleIncomingUser(ActivityManager.java:2038)
08-17 22:03:40.954: E/DatabaseUtils(2350):  at com.android.providers.settings.SettingsProvider.callFromPackage(SettingsProvider.java:607)
08-17 22:03:40.954: E/DatabaseUtils(2350):  at android.content.ContentProvider$Transport.call(ContentProvider.java:279)
08-17 22:03:40.954: E/DatabaseUtils(2350):  at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:273)
08-17 22:03:40.954: E/DatabaseUtils(2350):  at android.os.Binder.execTransact(Binder.java:388)
08-17 22:03:40.954: E/DatabaseUtils(2350):  at dalvik.system.NativeStart.run(Native Method)  

The app doesn't crash but the JSON file isnt parsed to display the data. Which is strange cause this is the same app I was using without signing a few minutes ago.

Is this because I signed the app with the same key that I used for my previous app?

PS: I tried adding the stated permission but it didnt help.

An SO User
  • 24,612
  • 35
  • 133
  • 221

2 Answers2

2

The error message is pretty explicit:

this requires android.permission.INTERACT_ACROSS_USERS_FULL

You need to try adding that permission to AndroidManifest.xml

The unsigned version you're running runs under Android's developer mode so it may be possible that's why it doesn't require that permission (I could find a reference to back this up and I lack the time to test it myself) or that the unsigned version you're building has code changes including that additional permission.

It's a system level permission that it's not supposed to grant to you unless you have the same signature as the system your app is running on.

Edit: For what its worth, there is at least once claim out there that the error can be a red-herring for a null pointer exception: http://www.silverbaytech.com/2014/04/11/android-error-android-permission-interact_across_users_full/

The short summary of that is ProGuard was acting up: Permission Denial Error - SpeechRecognizer as a continuous service? (android.permission.INTERACT_ACROSS_USERS_FULL)

Community
  • 1
  • 1
Rob S.
  • 3,599
  • 6
  • 30
  • 39
  • 1
    This is a signature level permission which won't be granted unless the app is signed with the same key as the system. – cygery Aug 17 '14 at 17:30
  • Okay here is what I did: I hit the "play" button in Eclipse to run the debug version (runs fine). Then, I exported the same app using the wizard. I copied the APK to my phone and installed the app. Blank UI – An SO User Aug 17 '14 at 17:39
  • [here is the app](https://play.google.com/store/apps/details?id=com.fasih.podcastr) if you would like to test it. – An SO User Aug 17 '14 at 17:41
  • What is your code trying to do that even requires this permission in the first place? Great app btw! – Rob S. Aug 17 '14 at 17:42
  • Nothing of the blue! It is trying to parse a JSON file in the BG and display images on the UI using Picasso. Like I said, URLs are in JSOn file. – An SO User Aug 17 '14 at 17:43
  • Where does it grab the file from? It might be better if you store the entire JSON string in SharedPreferences rather than directly on the filesystem. – Rob S. Aug 17 '14 at 17:45
  • The information about podcasts is in JSON. The idea is to modify the JSOn when the user adds or deletes the podcast. Much better and faster than XML – An SO User Aug 17 '14 at 17:46
  • Right, that's fine. I'm suggesting you store all the JSON information as a String in SharedPreferences rather than using the file system to avoid this error. – Rob S. Aug 17 '14 at 17:47
2

I modified my ProGuard config to include all the rules mentioned here.

And based on another answer by Eric LaFortune, I had to add all the classes that I use with GSON as exception to my ProGuard config. So, since I have a class named Response in my app, I had to add the rule:

-keepclassmembers com.littlejava.myapp.util.Response { <fields> };  

The app works file. As mentioned by Rob S., the logcat was just a red herring.

Community
  • 1
  • 1
An SO User
  • 24,612
  • 35
  • 133
  • 221