web-dev-qa-db-fra.com

Erreur de fusion manifeste - outils: remplacer ne fonctionne pas

Mettre à jour:

J'ai tout essayé. Y at-il quelque chose qui cloche avec l'outil de fusion Manifest?

  • outils: remplacer
  • outils: enlever
  • outils: ignorer
  • outils: noeud

Impossible de résoudre l'erreur suivante:

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.

Manifest.xml d'origine de l'application - Avant les outils: remplacer

 <?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>

Le fichier Manifest.xml de la bibliothèque:

<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>
11
Hisham Muneer

Dans mon cas, 

supprimer tools:ignore des fichiers Manifest et ajouter tools:replace="allowBackup,supportsRtl" a fonctionné pour moi.

Mettre à jour:

Une autre solution semble prometteuse, mais je ne l’ai jamais essayée.

 <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">
39
Hisham Muneer

Comme je le sais, nous ne pouvons pas utiliser à la fois tools:replace et tools:ignore. Vous pouvez donc en supprimer un de votre déclaration AndroidManifest.xml.

6

Ajouter le code suivant dans le fichier manifeste -

Il suffit d'ajouter des outils: replace = "Android: allowBackup" dans l'application Tag

<?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="com.example.exampleapp">

<application
        Android:allowBackup="true"
        Android:icon="@mipmap/ic_launcher"
        Android:label="@string/app_name"
        Android:supportsRtl="true"
        Android:theme="@style/AppTheme"
        tools:replace="Android:allowBackup">
</application>
0
Tushar Khandekar