发布于 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
中修复.我还没有找到实际的提交差异,如果有人知道如何找到这些提交,请发表评论。
还报告了这两个问题:
- 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 中收到 lint(视觉)警告,但它不会影响构建。
关于android - 可以 `tools:replace="安卓 :supportsRtl "` go along with ` tools:ignore ="AllowBackup"`?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39178543/