Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Manifest Merger error - tools:replace not working

Tags:

Update:

I have tried everything. Is there something wrong with Manifest merger tool?

  • tools:replace
  • tools:remove
  • tools:ignore
  • tools:node

Unable to resolve the following error:

D:\AndroidStudioProjects\Iknowthis2\app\src\main\AndroidManifest.xml:29:9-36 Error: Attribute application@allowBackup value=(false) from AndroidManifest.xml:29:9-36 is also present at [com.sackcentury:shinebutton:0.1.5] AndroidManifest.xml:12:9-35 value=(true).      Suggestion: add 'tools:replace="android:allowBackup"'to <application> element at AndroidManifest.xml:27:5-73:19 to override.  D:\AndroidStudioProjects\Iknowthis2\app\src\main\AndroidManifest.xml:34:9-36 Error:  Attribute application@supportsRtl value=(false) from AndroidManifest.xml:34:9-36 is also present at [com.sackcentury:shinebutton:0.1.5] AndroidManifest.xml:14:9-35 value=(true). Suggestion: add 'tools:replace="android:supportsRtl"' to <application> element at AndroidManifest.xml:27:5-73:19 to override. 

App's Original Manifest.xml - Before tools:replace

 <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools"     package="xyz">      <!-- Include following permission if you load images from Internet -->     <uses-permission android:name="android.permission.INTERNET" />     <!-- Include following permission if you want to cache images on SD card -->     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />      <application         android:name=".ABC"         android:allowBackup="false"         android:fullBackupContent="false"         android:hardwareAccelerated="true"         android:icon="@mipmap/ic_launcher"         android:label="@string/app_name"         android:supportsRtl="false"         android:theme="@style/Theme"         tools:ignore="GoogleAppIndexingWarning,UnusedAttribute">           <activity             android:name="com.facebook.FacebookActivity"             android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"             android:label="@string/app_name"             android:theme="@android:style/Theme.Translucent.NoTitleBar" />          <meta-data             android:name="com.facebook.sdk.ApplicationId"             android:value="@string/facebook_app_id" />          <activity             android:name=".activity.SignInActivity"             android:windowSoftInputMode="adjustPan">             <intent-filter>                 <action android:name="android.intent.action.MAIN" />                  <category android:name="android.intent.category.LAUNCHER" />             </intent-filter>         </activity>     </application>  </manifest> 

Library's Manifest.xml:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"     package="com.sackcentury.shinebuttonlib">      <application android:allowBackup="true" android:label="@string/app_name"         android:supportsRtl="true">      </application>  </manifest> 
like image 451
Hisham Muneer Avatar asked Sep 02 '16 06:09

Hisham Muneer


People also ask

How do I fix error manifest merger failed?

The initial process would be to open the manifest application known as the AndroidManifest. xml and then click on the Merged Manifest tab below your edit pane. Following which, Click on the merged manifest option. An Error would be visible at the right column and then one must try to solve the error.

What is supportsRtl?

android:supportsRtl="true" enables support for right-to-left languages. Without this, layout will always be left-to-right, However by itself it does not change the layout to be from right to left. It simply enables other attributes - one of those new attributes controls whether is left-to-right or right-to-left.

How do you do merged manifest?

Inspect the merged manifest and find conflicts Even before you build your app, you can see a preview of what your merged manifest looks by opening your AndroidManifest. xml file in Android Studio, and then clicking the Merged Manifest tab at the bottom of the editor.

How do I edit a manifest XML file?

The Android manifest file is a specially formatted XML file. You can edit the XML manually by clicking on the AndroidManifest. xml tab. Android manifest files generally include a single <manifest> tag with a single <application> tag.


1 Answers

In my case,

removing tools:ignore from the Manifest files and adding tools:replace="allowBackup,supportsRtl" worked for me.

Update:

One more solution looks promising, however I never tried it.

 <application     xmlns:tools="http://schemas.android.com/tools"  <-- added tools on application tag     android:name=".ABC"     android:allowBackup="false"     android:fullBackupContent="false"     android:hardwareAccelerated="true"     android:icon="@mipmap/ic_launcher"     android:label="@string/app_name"     android:supportsRtl="false"     android:theme="@style/Theme"     tools:replace="allowBackup,supportsRtl"     tools:ignore="GoogleAppIndexingWarning,UnusedAttribute"> 
like image 81
Hisham Muneer Avatar answered Sep 21 '22 09:09

Hisham Muneer