33

I am attempting to install my app on my new Samsung Galaxy S8 for the first time from Android Studio. When I do so, I get the following error message:

Installation failed with message Failed to finalize session : INSTALL_FAILED_DUPLICATE_PERMISSION: Package bbct.android attempting to redeclare permission bbct.android.lite.permission.READ already owned by com.samsung.android.bixby.agent.

Why does Bixby own my permission? More importantly how do I fix this?

Code-Apprentice
  • 81,660
  • 23
  • 145
  • 268
  • "Why does Bixby own my permission?" -- that certainly seems like an odd one for a Samsung app to declare. Download the [Applications Info](https://f-droid.org/en/packages/com.majeur.applicationsinfo/) app and see if you can find the manifest for `com.samsung.android.bixby.agent`. Based on the error, they should have a `` element that declares `bbct.android.lite.permission.READ`. – CommonsWare Feb 04 '18 at 16:18
  • @CommonsWare Is it possible that the Bixby agent controls **all** permissions and that I have to jump through some hoops with Samsung to register or otherwise request ownership of a permission? – Code-Apprentice Feb 04 '18 at 16:25
  • @CommonsWare Applications Info shows that `com.samsung.android.bixby.agent` does in fact have the permission `bbct.android.lite.permission.READ`, – Code-Apprentice Feb 04 '18 at 16:37
  • Is it possible that Bixby is 'scraping' data from your app to announce to the user? If they are, it may well be an historic work-around that they've applied. I used to have to do this with my apps and Tasker. See my question here for the possible explanation - https://stackoverflow.com/q/38234034/1256219 Even if they remove it, it could remain an issue for those that don't update. You may have to consider renaming your permission.... – brandall Feb 04 '18 at 18:09
  • @brandall Wouldn't that only require requesting the permission not declaring it? – Code-Apprentice Feb 04 '18 at 19:57
  • If your app is installed after Bixby, which I assume it would be (as Bixby is pre-installed?), the permission would not be granted, due to the install order issue that still plagues Android (links in the post mentioned above). Declaring your permission would have circumnavigated this on API <21. But considering Bixby is a new app this would seem unlikely, unless it's something that has sneaked through from an old test build of theirs. Even so, it all still seems very unlikely! Please do report back if you get to the bottom of it - I'm intrigued.... – brandall Feb 05 '18 at 14:21
  • @brandall See CommonsWare's comments and answers. Bixby Voice is an OEM app on Samsung devices similar to Apple's Siri. It declares a permission named `bbct.android.lite.permission.READ` which is identical to the one I am trying to declare. It looks like I will have to change my permission name. – Code-Apprentice Feb 05 '18 at 15:21
  • Yeah, I got that! I was just trying to offer some possible explanation as to why they would be declaring it (historically) https://issuetracker.google.com/issues/36941003 – brandall Feb 05 '18 at 15:53
  • @brandall Just to clarify, Bixby is **declaring** the permission, not requesting it. My app is also declaring it which causes an error when my app is installed. – Code-Apprentice Feb 05 '18 at 16:38
  • Yes, I 100% understand! As with the links I provided (and the links within them) the only reason I can possibly think that **they** would **declare** this, is to historically automatically grant Bixby **your** permission on API <21. It was a horrible bug/workaround that @CommonsWare is very familiar with. – brandall Feb 05 '18 at 16:59
  • @brandall It appears that the most likely explanation is a developer at Samsung borrowed [my code from here](https://stackoverflow.com/questions/14793672/requesting-read-permission-from-my-own-contentprovider-in-another-app). – Code-Apprentice Feb 05 '18 at 19:47

2 Answers2

28

I fired up my Galaxy S8, installed the Applications Info app, and found com.samsung.android.bixby.agent — it's listed as "Bixby Voice".

For whatever reason, in their manifest, they have a <permission> element for bbct.android.lite.permission.READ. It's the only non-com.samsung permission that I see for that app

On the plus side: Samsung knows who you are!

On the minus side: you're fairly well screwed.

Other than switching to some other permission name, your app will never be able to be installed on the Galaxy S8 or any other Samsung device that has this Bixby app (and is running Android 5.0+, though I think Bixby is only for newer devices). Two apps cannot declare the same permission on the same device on Android 5.0+ unless they are signed with the same signing key, and presumably yours is not.

(I am curious as to how this happened — is this the app? Is it open source?)

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • 2
    Yes, that is my app. The source is on GitHub at https://github.com/BaseballCardTracker/bbct. – Code-Apprentice Feb 04 '18 at 16:53
  • 3
    @Code-Apprentice: Their permission isn't `signature` and lacks a description or label. I don't know why it is there, and it seems unlikely that they copied your code. At the same time, I cannot explain why that particular permission name would be needed by that app, and why it is not in their standard `com.samsung` namespace. – CommonsWare Feb 04 '18 at 17:02
  • 26
    My permission name is shown in [this SO question](https://stackoverflow.com/questions/14793672/requesting-read-permission-from-my-own-contentprovider-in-another-app). Perhaps someone at Samsung borrowed the code snippet when implementing the permissions in Bixby. – Code-Apprentice Feb 05 '18 at 19:05
14

It appears that a developer at Samsung borrowed some code from another SO question I wrote years ago: Requesting read permission from my own ContentProvider in another app. This question originally contained the permission name which I used in my app. I have word from other SO members that this will be fixed in the next Bixby update.

Code-Apprentice
  • 81,660
  • 23
  • 145
  • 268