0

I am using the EasyImage library from https://github.com/jkwiecien/EasyImage.

I have this in my AndroidManifest.xml:

<provider
    android:name="`"
    android:authorities="${applicationId}.fileprovider"
    android:exported="false"
    android:grantUriPermissions="true">
    <meta-data
        android:name="android.support.FILE_PROVIDER_PATHS"
        android:resource="@xml/file_paths" />
</provider>

Getting this gradle error when compiling:

/home/babken/.../AndroidManifest.xml:216:13-64 Error:
Attribute provider#android.support.v4.content.FileProvider@authorities value=(com...fileprovider) from AndroidManifest.xml:216:13-64
is also present at [com.github.jkwiecien:EasyImage:1.3.1] AndroidManifest.xml:14:13-80 value=(com...easyphotopicker.fileprovider).
Suggestion: add 'tools:replace="android:authorities"' to <provider> element at AndroidManifest.xml:214:9-222:20 to override.
/home/babken/.../AndroidManifest.xml:221:17-51 Error:
Attribute meta-data#android.support.FILE_PROVIDER_PATHS@resource value=(@xml/file_paths) from AndroidManifest.xml:221:17-51
is also present at [com.github.jkwiecien:EasyImage:1.3.1] AndroidManifest.xml:19:17-50 value=(@xml/filepaths).
Suggestion: add 'tools:replace="android:resource"' to <meta-data> element at AndroidManifest.xml:219:13-221:54 to override.
Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Babken Vardanyan
  • 14,090
  • 13
  • 68
  • 87

1 Answers1

1

The solution is to extend android.support.v4.content.FileProvider with your custom class and use it instead:

package com....utils;

import android.support.v4.content.FileProvider;


public class CustomFileProvider extends FileProvider {
}

And use it in manifest:

<provider
    android:name=".utils.CustomFileProvider"
    android:authorities="${applicationId}.fileprovider"
    android:exported="false"
    android:grantUriPermissions="true">
    <meta-data
        android:name="android.support.FILE_PROVIDER_PATHS"
        android:resource="@xml/file_paths" />
</provider>
Babken Vardanyan
  • 14,090
  • 13
  • 68
  • 87