0

I have an Android app which I'm just trying to finish off for publication. I've been running it for a few days on Google Play as a Beta App and it has been fine. I uploaded a new Beta version today and it is behaving very strangely with buttons not working sometimes, crashes and just seemingly random errors all over the place. The app is not working at all. When I load it onto my phone from Android Studio it works. But when I send the signed version to Google Play and load it onto my phone it doesn't. It seems to be getting this error nearly all the time:

 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:13140)
 at android.app.ActivityManager.handleIncomingUser(ActivityManager.java:2038)
 at com.android.providers.settings.SettingsProvider.callFromPackage(SettingsProvider.java:607)
 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)

This seems to have something to do with SQLite, which my app uses a lot, but I really don't know what code to post because I don't know exactly where the error is coming from. Sorry about the lack of information, I don't know where to start with this. I have found other posts about the same error but they all seem to say not to add the

android.permission.INTERACT_ACROSS_USERS_FULL

permission to the manifest, but I don't have that in my manifeset and, as far as I am aware I'm not doing anything to interact across users.

All this seems to have coincided with some Android Studio updates I did this morning. I couldn't say what they were, I just accepted them and watched them install, could this be a possible issue?

Again, sorry for the rambling and a lack of information. Any help would be greatly appreciated!

Edit:

I have tried everything I can find in other questions to fix this and none of the solutions have worked. I have twice done a Clean of the project and resent the .apk to Google Play, but the errors are still happening. I tried using a new key to sign the project but Google Play won't let me upload it with a different key. I don't know where to go from here.

I get the feeling that this has all stemmed from the Android Studio Upgrade I did yesterday, it seems to have somehow corrupted my project, but I don't know anything about the file structure and I don't know where to look.

As an aside, clicking "show in folder" when my .apk file has been compiled seems to have told Windows 10 to permanently open a new window in explorer every time I click on a folder, which is very annoying. This is probably unrelated but this version of Android Studio does seem to be doing strange things. It is also highlighting an error in my code where I have:

calendar.get(Calendar.MONTH) == Calendar.SEPTEMBER

The error says:

Must be one of: Calendar.Sunday, Calendar.Mondy, Calendar.Tuesday, Calendar.Wednesday, Calendar.Thursday, Calendar.Friday, Calendar.Saturday

All of these things have happened since I upgraded Android Studio yesterday. If anyone can help I would be very grateful. Thank you for your time.

Pawan
  • 533
  • 1
  • 7
  • 31
kwibbler
  • 147
  • 10
  • Did you google the error message? – Code-Apprentice Sep 28 '16 at 22:53
  • Possible duplicate of [Permission Denial: this requires android.permission.INTERACT\_ACROSS\_USERS\_FULL](http://stackoverflow.com/questions/20578474/permission-denial-this-requires-android-permission-interact-across-users-full) – Code-Apprentice Sep 28 '16 at 22:53
  • Yes, I couldn't find a solution. Just answers about the Interact Acros All Users permission. – kwibbler Sep 28 '16 at 22:55
  • The possible duplicate given provides this answer: – kwibbler Sep 28 '16 at 22:58
  • 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. – kwibbler Sep 28 '16 at 22:58
  • [This answer](http://stackoverflow.com/a/25638463/1440565) suggests clean-and-build. Did you try that? – Code-Apprentice Sep 28 '16 at 22:59
  • But I'm not trying to use that permission, as I stated in my question. – kwibbler Sep 28 '16 at 22:59
  • I didn't see the clean-and-build suggestion, no. Thank you Code-Apprentice, I'm trying now. I think it may take about an hour before I can test and confirm because I'll have to wait for it to appear on Google Play. Unless there is a way of checking for "conflicts in the bin directory" to confirm. Sorry I'm very new to this. – kwibbler Sep 28 '16 at 23:03
  • Did you have this issue when running your app from Android Studio? – Code-Apprentice Sep 28 '16 at 23:23
  • No Code-Apprentice. When I load to my device from Android Studio it runs fine. – kwibbler Sep 28 '16 at 23:35
  • I have just done Clean Project -> Rebuild Project. Then I changed the version number in the Build.Gradle, then Sync. Then Generate Signed APK and upload to Google Play. The error is still there. I'm not sure if I'm doing something wrong in this process. – kwibbler Sep 28 '16 at 23:36
  • I have edited the question, does anyone have any ideas? Thank you. – kwibbler Sep 29 '16 at 10:30

1 Answers1

0

The name of the getUserId() method in any activity conflicts with the getUserId() in the system's Context.java so change that. worked for me