0

Manifest: Error:Execution failed

Error:Execution failed for task ':app:processDebugManifest'. > Manifest merger failed : Attribute permission#<YOUR PACKAGE>.permission.C2D_MESSAGE@name value=(.permission.C2D_MESSAGE) from AndroidManifest.xml

This error generate on Android Studio to build a project. How to solve this error?

Supriya
  • 290
  • 4
  • 15

2 Answers2

0

The problem is (as the error message shows) the same permission is available in another manifest (firebase manifest). So you can remove it from your manifest to solve the problem (easy approach). You can also override it in your manifest like below:

<permission android:name="<your-package-name>.permission.C2D_MESSAGE"
        android:protectionLevel="signature" 
        tools:replace="android:name"/>

For using tools you need to add the xmlns:tools="http://schemas.android.com/tools" line in the manifest tag as below:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
          android:allowBackup="false"
          android:label="@string/app_name"/>
Akram
  • 2,158
  • 1
  • 17
  • 24
0

You can just write below code in your AndroidManifest.xml.

<manifest ...
    xmlns:tools="http://schemas.android.com/tools"
    ...>

And in the application tag ->

  <application
    ...
    tools:replace="android:name">
Ekta Bhawsar
  • 746
  • 11
  • 26