android - 可以 `tools:replace="安卓 :supportsRtl "` go along with ` tools:ignore ="AllowBackup"`?

标签 android android-manifest

发布于 https://stackoverflow.com/a/39178185/3286489 , 解决错误如下

Error:Execution failed for task ':app:processProductionDebugManifest'.
> Manifest merger failed : Attribute application@supportsRtl value=(false) from AndroidManifest.xml:23:9-36 
is also present at [com.mylibrarypackage:mylibrary:1.0.0] AndroidManifest.xml:14:9-35 value=(true). 
Suggestion: add 'tools:replace="android:supportsRtl"' to <application> element at AndroidManifest.xml:18:5-67:19 to override.

我们可以使用添加 tools:replace="android:supportsRtl" 如下。

<application 
    android:label="@string/app_name"
    android:supportsRtl="false"
    tools:replace="android:supportsRtl"/>

这有效。

但是,如果我们在应用程序标签中有 tools:ignore="AllowBackup",似乎 tools:replace 没有效果,并且上述错误仍然存​​在。

<application 
    android:label="@string/app_name"
    android:supportsRtl="false"
    tools:ignore="AllowBackup"
    tools:replace="android:supportsRtl"/>

这是一个错误吗?或者我错过了什么?

最佳答案

事实证明这是他们这边的问题,已在 I32310f1c4a1e6e8847aa14be34689c5ed406e2a7 中修复.我还没有找到实际的提交差异,如果有人知道如何找到这些提交,请发表评论。

还报告了这两个问题:

这两个问题都标记为已解决。我的最终版本 <application>标签只是 replace东西,我删除了所有ignore属性和构建通过。我现在在 Android Studio 中收到 lint(视觉)警告,但它不会影响构建。

关于android - 可以 `tools:replace="安卓 :supportsRtl "` go along with ` tools:ignore ="AllowBackup"`?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39178543/

相关文章:

android - 带有自定义 View 的可折叠工具栏随着滚动的发生而移动并固定(就像在留声机中一样)

android - 警告 : Keybinding conflicts occurred in Eclipse ADT

java - Android studio 上的 Activity 如何相互跟随?

java - 与android的蓝牙通信中的错误检测

android - 为什么我们需要使用 <uses-feature> 属性?

安卓 list : Some devices are not supported?

android - 如何更改 Android 应用程序的名称?

java - 从两个 SSLSockets(客户端)获取多个流

android - 如何在保持向后兼容性的同时将 foregroundServiceType 添加到库 list ?

android - 如何制作Activity,不覆盖全屏