0
Installation did not succeed.
The application could not be installed: INSTALL_FAILED_CONFLICTING_PROVIDER

This error has bugged me for 2 hours now. I have counterchecked implementation of FileProvider as instructed in the documentation and now appears as follows.

    <provider
        android:name="androidx.core.content.FileProvider"
        android:authorities="${applicationId}.fileprovider"
        android:exported="false"
        android:grantUriPermissions="true"
        android:multiprocess="false">
        <meta-data
            android:name="android.support.FILE_PROVIDER_PATHS"
            android:resource="@xml/provider_paths" />
    </provider>

Important: I am testing two applications. When one is already installed in the emulator, this error appears. I need the two apps install successfully. Please do not tell me to uninstall the old one then run new one. Thank you.

Tonui Nicholus
  • 395
  • 2
  • 8
  • both application have same file provide may possible please check that both apk hase same packageName ? – Ashvin solanki May 30 '20 at 08:56
  • the apps have different package names. By same file provider, did you mean what I posted in my question? Shouldn't the ${applicationId} make it dynamic? – Tonui Nicholus Jun 01 '20 at 17:51
  • 2
    I finally solved it. Important: update all providers in manifest appropriately. Did so by making the search provider authority dynamic to the package name. I was using same authority for my SearchRecentSuggestionsProvider https://developer.android.com/reference/android/content/SearchRecentSuggestionsProvider#constants – Tonui Nicholus Jun 02 '20 at 11:44
  • Cheers :) dude. – Ashvin solanki Jun 02 '20 at 13:45
  • @TonuiNicholus I solved it by `removing all provider in manifest except the manifest we currently need it for run/build`. I think they need to provide the more simple solution for this. Imagine there are many projects need this provider, then we have to remove it one by one every time we want to navigate another project to build. – Marfin. F Aug 12 '23 at 14:02

1 Answers1

0

I reccomend look this post here first Install shows error in console: INSTALL FAILED CONFLICTING PROVIDER

If none of the answers on the above post works, you could try: (IN CASE YOU DON'T NEED THE TWO APPLICATIONS INSTALLED IN THE SAME DEVICE)

  • Go to your phone/emulator Settings -> Apps
  • Search for your app name/package name
  • Uninstall
groff07
  • 2,363
  • 3
  • 32
  • 48