Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manifest merger failed with multiple error #108

Closed
nakharin opened this issue Mar 14, 2017 · 6 comments
Closed

Manifest merger failed with multiple error #108

nakharin opened this issue Mar 14, 2017 · 6 comments

Comments

@nakharin
Copy link

Hello, I need you help this problem.

Merging Errors: Error: Attribute provider#android.support.v4.content.FileProvider@authorities value=(com.emcsthai.ieasy.demo.easyphotopicker.fileprovider) from AndroidManifest.xml:14:13-80 is also present at AndroidManifest.xml:292:13-73 value=(com.emcsthai.ieasy.demo.universalfileprovider). Suggestion: add 'tools:replace="android:authorities"' to element at AndroidManifest.xml:12:9-20:20 to override. app main manifest (this file), line 13 Error: Attribute meta-data#android.support.FILE_PROVIDER_PATHS@resource value=(@xml/filepaths) from AndroidManifest.xml:19:17-50 is also present at AndroidManifest.xml:297:17-70 value=(@xml/universal_file_provider_paths). Suggestion: add 'tools:replace="android:resource"' to element at AndroidManifest.xml to override. app main manifest (this file), line 18

@daividssilverio
Copy link

@nakharin
I've worked around this by extending the FileProvider class and changing my manifest to:

<provider
     android:name=".presentation.util.WorkaroundProvider"
     android:authorities="${applicationId}.provider"
     android:exported="false"
     android:grantUriPermissions="true">
     <meta-data
       android:name="android.support.FILE_PROVIDER_PATHS"
       android:resource="@xml/provider_paths" />
</provider>

well... it worked

@tudor-pop
Copy link

tudor-pop commented Apr 5, 2017

this also worked for me. Read more how it works here

Update 1
My merge failed because I already had a provider in my manifest so there was a conflict. I added
tools:replace="android:authorities" to my provider and tools:replace="android:resource" to my provider's meta-data.
Old provider:

<provider
     android:name="android.support.v4.content.FileProvider"
     android:authorities="com...fileprovider"
     android:exported="false"
     android:grantUriPermissions="true"
     >
      <meta-data
          android:name="android.support.FILE_PROVIDER_PATHS"
          android:resource="@xml/file_paths"
      />
</provider>

New provider:

<provider
      android:name="android.support.v4.content.FileProvider"
      android:authorities="com...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>

These suggestions were given by Android Studio Manifest Merger Tool. Cheers!

@jkwiecien
Copy link
Owner

I think this is already solved by ExtendedFileProvider class

@stillie
Copy link

stillie commented Jun 25, 2018

Good day,

I am having the same issue, I have tried this solution, but then the EasyImage library breaks when i apply this solution? Any other way that we can fix this issue?

EDIT: This seemed to fix the issue. If anyone else is having a problem.

#137

@thanhdnv-1252
Copy link

I am having the same issue, I fixed it

<provider
      ....
      tools:replace="android:authorities"
      >
      <meta-data
          ...
      />
</provider>

and

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.xxx"
    xmlns:tools="http://schemas.android.com/tools">

@yongqiangyue
Copy link

yongqiangyue commented Aug 31, 2018

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.xxx"
xmlns:tools="http://schemas.android.com/tools" >
......
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="com...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"
/>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants