I'm trying to use a library that has this in its AndroidManifest.xml:
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="${applicationId}.imagepicker.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths"/>
</provider>
I have the same tag in my app's AndroidManifest.xml:
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="@string/FileProviderAuthority"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths"></meta-data>
</provider>
So it obviously gives a Manifest merger error:
Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed with multiple errors, see logs
Which suggests to "add 'tools:replace="android:authorities"' to element at AndroidManifest.xml to override".
So I add tools:replace="android:authorities"
like this, in my app's AndroidManifest.xml:
<application
tools:replace="android:authorities"
android:name=".appcontroller.AppController"
android:allowBackup="true"
android:hardwareAccelerated="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:largeHeap="true"
android:supportsRtl="true"
android:theme="@style/AppTheme">
And then I get this error:
Error:
tools:replace specified at line:25 for attribute android:authorities, but no new value specified
The same happens with tools:replace="android.support.v4.content.FileProvider"
.
What am I missing?