"tools:replace =" android:supportsRtl"可以和"tools:ignore =" AllowBackup"一起使用吗? [英] Can `tools:replace="android:supportsRtl"` go along with `tools:ignore="AllowBackup"`?

查看:788
本文介绍了"tools:replace =" android:supportsRtl"可以和"tools:ignore =" AllowBackup"一起使用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

https://stackoverflow.com/a/39178185/3286489 中所述,以解决以下错误

As posted in https://stackoverflow.com/a/39178185/3286489, to solve the error as below

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

We could use add tools:replace="android:supportsRtl" as below.

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

这有效.

但是,如果我们在application标记中包含tools:ignore="AllowBackup",则tools:replace似乎无效,并且上述错误仍然存​​在.

However if we have tools:ignore="AllowBackup" in the application tag, seems like the tools:replace is has not effect, and the above error persist.

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

这是一个错误吗?还是我想念什么?

Is this a bug? Or I miss something?

推荐答案

原来,这是一个问题,已在I32310f1c4a1e6e8847aa14be34689c5ed406e2a7中修复.我尚未找到实际的提交差异,如果有人知道如何查找那些提交,请发表评论.

Turns out it was an issue on their side, fixed in I32310f1c4a1e6e8847aa14be34689c5ed406e2a7. I haven't found the actual commit diff, if someone knows how to find those commits, please comment.

还报告了以下两个问题:

Also there are these two issues reported:

  • https://code.google.com/p/android/issues/detail?id=193679
  • https://code.google.com/p/android/issues/detail?id=205956

两个问题均标记为已解决.我的<application>标签的最终版本只是replace东西,我删除了所有ignore属性,并通过了构建.现在,我在Android Studio中出现了皮棉(视觉)警告,但这并没有影响构建.

Both issues are marked as resolved. Final version of my <application> tag was just the replace stuff, I deleted all ignore attributes and the build passed. I now have lint (visual) warnings in Android Studio, but it's not affecting the build.

这篇关于"tools:replace =" android:supportsRtl"可以和"tools:ignore =" AllowBackup"一起使用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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