清单合并错误-工具:无法正常工作 [英] Manifest Merger error - tools:replace not working

查看:88
本文介绍了清单合并错误-工具:无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经尝试了一切.清单合并工具出了什么问题?

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

  • 工具:替换
  • tools:remove
  • tools:ignore
  • tools:node
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-在工具之前:替换

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

推荐答案

就我而言,

从清单文件中删除tools:ignore并添加tools:replace="allowBackup,supportsRtl"对我有用.

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

另一个解决方案看起来很有希望,但是我从未尝试过.

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

这篇关于清单合并错误-工具:无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆