当前位置:   article > 正文

Android异常篇 Manifest merger failed : Attribute application@label value=() from AndroidM_manifest merger failed : attribute application@sup

manifest merger failed : attribute application@supportsrtl value=(true) from

一、问题复现

导入某个第三方依赖后,出现label冲突
在这里插入图片描述

一般是项目中使用的第三方依赖库中的AndroidManifest.xml中跟当前App的AndroidManifest.xml中有重复的某些属性时AS会提示这个,按照提示添加就可以解决

二、解决方案

以上蓝色框就是error错误给出的解决方案(很多时候,Android开发工具在异常处就已经提示的解决方案,仔细看就行)

(1)打开AndroidManifest.xml
(2)在Application内添加label冲突替换

tools:replace="android:label"
  • 1

三、结果

<application
        android:name=".app.AppApplication"
        android:allowBackup="true"
        android:icon="@drawable/app_icon"
        android:label="@string/app_name"
        android:theme="@style/AppTheme"
        tools:replace="android:theme, android:label">
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

需要导入tools命名 : xmlns:tools=“http://schemas.android.com/tools”

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:tools="http://schemas.android.com/tools"
          package="com.xxxx.app">
  • 1
  • 2
  • 3

还可以对Activity标签的属性进行替换:

<activity
    android:name=".XXXXXActivity"
    android:screenOrientation="portrait"
    tools:replace="screenOrientation" />
  • 1
  • 2
  • 3
  • 4
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/黑客灵魂/article/detail/824168
推荐阅读
相关标签
  

闽ICP备14008679号