document_scanner_flutter icon indicating copy to clipboard operation
document_scanner_flutter copied to clipboard

INSTALL_FAILED_CONFLICTING_PROVIDER: Package couldn't be installed

Open rishabhj126 opened this issue 2 years ago • 6 comments

Trying to install same dependency in two apps gives

Failure [INSTALL_FAILED_CONFLICTING_PROVIDER: Package couldn't be installed in /data/app/com.ysh.sdb--5GF3pMkE5_bKqOwmq56_g==: Can't install because provider name com.scanlibrary.provider (in package com.ysh.sdb) is already used by com.ysh.xzsd] Error launching application on LON AL00.

rishabhj126 avatar Mar 10 '22 11:03 rishabhj126

add this in /android/app/src/main/AndroidManifest

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

rajada1 avatar Mar 10 '22 20:03 rajada1

hey @rishabhj126 ,i think your phone already have an app that uses the same package try to uninstall it and and run your new app . i hope this will solve your problem

samoray1998 avatar May 11 '22 14:05 samoray1998

hey @rishabhj126, acho que seu telefone já tem um aplicativo que usa o mesmo pacote tente desinstalá-lo e executar seu novo aplicativo . espero que isso resolva o seu problema

This is not a viable solution.

rajada1 avatar May 11 '22 15:05 rajada1

hey @rishabhj126 ,i think your phone already have an app that uses the same package try to uninstall it and and run your new app .

i hope this will solve your problem

But both app requires to have same feature then what to do?

rishabhj126 avatar May 11 '22 15:05 rishabhj126

i know that it's not a great solution but it may save a lot of people time, i had the same issue and i solve it this way ,so,just try at the first beginning to remove the old app and test the new one and see if it works for you.

samoray1998 avatar May 19 '22 14:05 samoray1998

@rishabhj126 you are facing this issue because the package owner has not handled the FIleProvider properly.

I have made some changes and fixed this issue

Please follow the below steps, it will resolve your problem:

Step 1: In your pubspec.yaml file (remove document scanner and add this)

document_scanner_flutter:
  git:
    url: https://github.com/sanjeevinnobit/document_scanner_flutter.git
    ref: master

Step 2: add this in /android/app/src/main/AndroidManifest

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

Step 3: in your /android/app/build.gradle

minSdkVersion 21

sanjeevinnobit avatar Jun 06 '23 20:06 sanjeevinnobit