After adding a FileProvider to my application’s AndroidManifest, I started getting the following error.
/main/AndroidManifest.xml:40:13-69 Error:
Attribute provider#androidx.core.content.FileProvider@authorities value=(com.myapp.provider) from AndroidManifest.xml:40:13-69 is also present at [com.sendbird.sdk:uikit:2.1.5] AndroidManifest.xml:107:13-60 value=(com.myapp.provider).
Suggestion: add 'tools:replace="android:authorities"' to <provider> element at AndroidManifest.xml:38:9-48:20 to override.
In the UiKit’s Android Manifest, I can see another FileProvider is being declared.
Note that the error only happens when the same provider android:name is used. I have created an empty subclass and declared it in the AndoirdManifest and it works fine. I would also assume that following the suggestion of overriding the AndroidManifest definition will break things on the SendBird UiKit sdk, although I haven’t really tested it.
I do not want my app to query SendBird defined file provider for separation of concerns and general rule of not depending on libraries implementations, hence this request:
Would it be possible for the team to create a SendBird specific subclass of the FileProvider and an authority?
I think this makes sense, as it makes the SendBird sdk easier to integrate and less intrusive to app developers.
tools:replace will only make sense to use if I decide to override the SendBird FileProvider definition, which I believe it will break the SendBird sdk, as the authority and provider paths might be different.
Since I’m going with my own subclass for now, tools:replace is not needed.