I\'m trying to use a library that has this in its AndroidManifest.xml:
To solve this there are two options: either you change your manifest to use a different class than android.support.v4.content.FileProvider
or you create a PR/issue asking the owner of the lib to change his/hers (that would be the best case scenario).
If you want a quick fix, just create a class that extends FileProvider
such as:
import android.support.v4.content.FileProvider;
public class MyFileProvider extends FileProvider {
}
and in your manifest file you change it to:
<provider android:name=".MyFileProvider" ... >
Since you do not change any of the values in the provider, you do not need to include it in your manifest. Just remove those lines.
For those using sdk 28 and up, if you are migrating to androidx, solution is :
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileprovider"
android:exported="false"
android:grantUriPermissions="true"
tools:replace="android:authorities">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths"/>
</provider>
Add to your AndroidManifest.xml
file, inside the application
tag:
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="${applicationId}.fileprovider"
android:exported="false"
android:grantUriPermissions="true"
tools:replace="android:authorities">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths"
tools:replace="android:resource" />
</provider>