ParkSangGwon / TedImagePicker

TedImagePicker is simple/beautiful/smart image picker
549 stars 103 forks source link

FileProvider collision error #97

Open LebonNic opened 2 years ago

LebonNic commented 2 years ago

Hi!

I am trying to integrate your library into an existing application and I get the following error:

Error: Attribute provider#androidx.core.content.FileProvider@authorities value=(com.appname.client.fileprovider) from AndroidManifest.xml:37:13-72 is also present at [io.github.ParkSangGwon:tedimagepicker:1.2.7] AndroidManifest.xml:34:13-60 value=(com.company.appname.provider). Suggestion: add 'tools:replace="android:authorities"' to <provider> element at AndroidManifest.xml:35:9-43:20 to override.

In my application I already use a FileProvider and it collides with the one declared in your library. You should follow the recommendations of this article to avoid this problem: https://commonsware.com/blog/2017/06/27/fileprovider-libraries.html

Best regards, Nicolas

bymagnum commented 4 months ago

I join this one, I can't build the application due to the fact that there is not enough separately created FileProvider class, my manifest swears at merging the same names androidx.core.content.FileProvider

tbassett44 commented 5 days ago

I fixed this by updating my AndroidManifest.xml, the instructions in the error were not complete in the error, but enough to get started.

In the < manifest > tag, include xmlns:tools="http://schemas.android.com/tools" In the < provider > tag at issue, include tools:replace="android:authorities" in the < meta-data > tag in the tag, include tools:replace="android:resource"

I honestly dont know why those things work, but trial and error got me to an app build and the image picker working in my app. Im not sure if it is fully functional either, but to at least have picking an image working is a big step because ive been dealing with this issue for a number of months at this point.