Reputation: 24998
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.
Upvotes: 1
Views: 388
Reputation: 24998
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.
Upvotes: 2
Reputation: 3609
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)
Upvotes: 2