Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install app-photos-debug.apk -> INSTALL_FAILED_CONFLICTING_PROVIDER #60

Closed
morpheux74 opened this issue Nov 18, 2021 · 8 comments
Labels
question Further information is requested

Comments

@morpheux74
Copy link

morpheux74 commented Nov 18, 2021

Describe the bug

I get
Failure [INSTALL_FAILED_CONFLICTING_PROVIDER: Scanning Failed.: Can't install because provider name com.google.android.gsf.gservices (in package com.google.android.apps.photos) is already used by com.google.android.gsf]
when trying to install app-photo-debug.apk via the adb command :
adb shell pm install --force-queryable /data/local/tmp/app-photos-debug.apk

To Reproduce

Steps to reproduce the behavior:

  • Install Google Play Services in a secondary user profile
  • Go on the clean primary user profile
  • Push app-photos-debug.apk on /data/local/tmp/ : adb push app-photos-debug.apk /data/local/tmp/
  • Run the installation adb command : adb shell pm install --force-queryable /data/local/tmp/app-photos-debug.apk
  • See error :
    Failure [INSTALL_FAILED_CONFLICTING_PROVIDER: Scanning Failed.: Can't install because provider name com.google.android.gsf.gservices (in package com.google.android.apps.photos) is already used by com.google.android.gsf]

Smartphone

Device: Pixel 3a
OS/ROM: GrapheneOS 11 (SP1A.211105.002.2021111414)
Gcam-Services-Provider version: 1.4

Additional context

There is Google Play Services installed on a Sandbox (another user profile), but not on the user profile I'm trying to install app-photo-debug.apk

@lukaspieper
Copy link
Owner

Hi,

please update this issue to match the issue template and provide more information about your use case.

Thanks!

@Gladox114
Copy link

Got exactly the same Error on Pixel 5 with Graphene OS. It's conflicting with the sandboxed Google Play services. But they should be sandboxed. Why do they conflict on different workprofiles?

I am using Insular to Sandbox them.

@Gladox114
Copy link

Gladox114 commented Nov 20, 2021

The response of strcat was to just use Google Play Services on your main Profile because Graphene OS sandboxes every app.

I just installed Google Play Services on my main Profile and restricted Network and Sensor access. It shouldn't be able to do any harm I think. So there is no need to fake it.

So just install com.google.android.gsf and restrict everything to it to use Gcam.

Edit: you also need to reinstall Gcam again (in my case) to make it work.

@lukaspieper
Copy link
Owner

Saw the discussion on Matrix and just want to comment on that here.

Gcam-Services-Provider uses official app IDs that don't belong to them
That's how it works
You're trying to install two apps with the same app ID
Those will conflict with each other because they're not signed the same

My app (the basic variant) has not been using Google's ApplicationId for a couple of versions. The variant with gallery support, on the other hand, must use the ApplicationId from Google Photos. So both do not use com.google.android.gsf as ApplicationId.

However, both variants of the app register a provider with the id com.google.android.gsf.gservices. This provider is of course included in the app com.google.android.gsf and that is why the installation does not work, because there can never be two providers with the same ID. This therefore has nothing to do with signing (except when using Google Photos).

But they should be sandboxed. Why do they conflict on different workprofiles?

This has already been answered perfectly by Daniel. Here is a quote:

when you install an app in any user / work profile, it installs the apk globally and enforces key pinning / downgrade protection based on the currently installed one
if you update the app in any profile, it updates it globally, you don't have to update it in each
it doesn't keep a separate copy of the apk for each profile where an app is installed and they don't need to be separately updated, and the key pinning / downgrade protection is enforced across all

So why do I continue to maintain this app, even though I use GrapheneOS myself and could simply use the app com.google.android.gsf? GSF not only provides the necessary interfaces to get Google Camera working, but also takes care of other things. These additional interfaces, which do not exist in my app, can have (side) effects on other apps.
Providing only the bare essentials has always been a core feature of this project. Before I put this app together, you could get Gcam to work with microg (of course also in a sandbox and without privileges like any app), but there were a lot of side effects.

By the way, questions similar to these have already been answered in previous issues. This is not a bug in my app, but a reasonable restriction of the OS.

@lukaspieper lukaspieper added the question Further information is requested label Nov 20, 2021
@morpheux74
Copy link
Author

There's something I can hardly understand : If you install play services on main profile, don't log in, and restrict every privilege including Network, where would be the security issue ? What is the value-added of Gcam-Services-Provider then ?

Anyway, thanks @lukaspieper, too bad I can't use your solution, thank you anyway for your time and your involvement in the community !

@lukaspieper
Copy link
Owner

If you install play services on main profile, don't log in, and restrict every privilege including Network, where would be the security issue ? What is the value-added of Gcam-Services-Provider then ?

I have not used the word security at all so far, for the simple reason that there is no security benefit. I have only talked about compatibility and side effects. It may be that GSF causes side effects on other apps.

But now let's talk in practical terms. This app has been around much longer than the GrapheneOS compatibility layer. From today's perspective, I might not have developed this app at all, but more than a year and a half ago there was no good alternative.
For all those who use the new compatibility layer in GrapheneOS, my app is no longer usable. For many other users (there are also users without GrapheneOS), my app is still the best way to go. Also, the preview button does not work with GSF and without Google Photos, which is a new feature here since a few versions.

Anyway, thanks @lukaspieper, too bad I can't use your solution, thank you anyway for your time and your involvement in the community !

You're welcome.

@lukaspieper lukaspieper pinned this issue Nov 22, 2021
@e-t-l
Copy link

e-t-l commented Dec 5, 2022

lukaspieper Thank you for being so responsive with explaining things in this thread. I'm new to Graphene and trying to follow: Is it possible to use the Photos version of this app on Graphene? I get an error that it cannot install "due to unknown error", even if I've completely uninstalled Graphene's play store/services/framework apps. My main interest is to get gcam's Photos shortcut to work. Sorry if you already answered this and I missed it, but is this possible?

Nevermind, I found the Calyx Photos Preview app!

@lukaspieper
Copy link
Owner

Nevermind, I found the Calyx Photos Preview app!

Also you found a suitable solution let me answer one or two things (for future readers).

Is it possible to use the Photos version of this app on Graphene?

Yes absolutely. The compatibility restrictions of the basic version apply plus the fact that you cannot have Google Photos installed.

I get an error that it cannot install "due to unknown error", even if I've completely uninstalled Graphene's play store/services/framework apps.

There are technical solutions to get the real cause of the issue. For the average user that error messages would not be too advanced. As I had this a few days back I might need to consider documenting the steps somewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants