I have two app which use same ContentProvider
"it.federicoboschini:resource-file-provider:1.0.0". When I Install Both Application same time it crashes, Even After I have published my app on Play store, But it has same problem.
I thought, It will resolve after changing Path and name in paths.xml. But it can't.
In Manifest :
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="@string/rfp_provider_authority"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/paths" />
</provider>
Paths.xml :
<?xml version="1.0" encoding="utf-8" ?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<files-path name="all" path="/"> </files-path>
</paths>
In button clicklistener
try {
ResourceFileProvider.Builder.from(this)
.setDirectory(FOLDER_RAW)
.setFileName("my_sound")
.setFileExtension("mp3")
.setFileType(TYPE_AUDIO)
.build()
.shareFile();
} catch (FileNotFoundException e) {
e.printStackTrace();
}