INSTALL_FAILED_DUPLICATE_PERMISSION with Samsung Galaxy S8
Asked Answered
F

2

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?

Foucquet answered 4/2, 2018 at 16:10 Comment(11)
"Why does Bixby own my permission?" -- that certainly seems like an odd one for a Samsung app to declare. Download the Applications Info app and see if you can find the manifest for com.samsung.android.bixby.agent. Based on the error, they should have a <permission> element that declares bbct.android.lite.permission.READ.Pontifex
@Pontifex 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?Foucquet
@Pontifex Applications Info shows that com.samsung.android.bixby.agent does in fact have the permission bbct.android.lite.permission.READ,Foucquet
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://mcmap.net/q/453356/-android-custom-permissions-marshmallow/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....Fireweed
@Fireweed Wouldn't that only require requesting the permission not declaring it?Foucquet
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....Fireweed
@Fireweed 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.Foucquet
Yeah, I got that! I was just trying to offer some possible explanation as to why they would be declaring it (historically) issuetracker.google.com/issues/36941003Fireweed
@Fireweed 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.Foucquet
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 @Pontifex is very familiar with.Fireweed
@Fireweed It appears that the most likely explanation is a developer at Samsung borrowed my code from here.Foucquet
P
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?)

Pontifex answered 4/2, 2018 at 16:37 Comment(3)
Yes, that is my app. The source is on GitHub at github.com/BaseballCardTracker/bbct.Foucquet
@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.Pontifex
My permission name is shown in this SO question. Perhaps someone at Samsung borrowed the code snippet when implementing the permissions in Bixby.Foucquet
F
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.

Foucquet answered 11/2, 2018 at 16:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.