如何在Android清单应用程序中添加多个`tools:replace`?

177

我正在使用一个库,它在其清单中含有以下内容。

<application android:allowBackup="true"
    android:label="@string/app_name"
    android:supportsRtl="true"/>

然而,由于我使用的应用程序包含了相反的设置库,因此发生了反向的情况。

<application android:allowBackup="false"
    android:label="@string/app_name"
    android:supportsRtl="false"/>
因此它会出现合并错误,例如库清单中的 `android:supportsRtl="true"` 是必不可少的吗? 有时它会引起错误
要解决这个问题,我们只需要在清单应用程序中添加以下内容。
tools:replace="android:supportsRtl"

tools:replace="android:allowBackup"

然而,在编译时添加两个tools:replace会出现错误。我该如何组合这两个tools:replace

我尝试了以下方法,但它没有起作用。

tools:replace="android:supportsRtl|android:allowBackup"

37
尝试使用逗号工具:replace="android:supportsRtl,android:allowBackup" - Boldijar Paul
2个回答

379

根据上面问题的评论中Paul的回答,使用逗号:

 tools:replace="android:supportsRtl,android:allowBackup"

-1

例子:

tools:replace="android:label,android:allowBackup,android:supportsRtl"

6
请解释一下你的回答与被接受的回答相比有何不同。为什么你的更好? - BDL

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接