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

news/2024/10/18 18:19:32/

一、问题复现

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

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

二、解决方案

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

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

tools:replace="android:label"

三、结果

<applicationandroid: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">

需要导入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">

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

<activityandroid:name=".XXXXXActivity"android:screenOrientation="portrait"tools:replace="screenOrientation" />

http://www.ppmy.cn/news/149390.html

相关文章

Android 11 报错 java.io.IOException: Cleartext HTTP traffic to xxx not permitted

Android 11 应用 POST 网络请求报错 ( java.io.IOException: Cleartext HTTP traffic to xxx not permitted ) 在 AndroidManifest.xml 清单文件中 , 在 application 节点设置 android:usesCleartextTraffic“true” 属性即可 ;

git项目提交报rejected问题解决

问题&#xff1a; Push rejected: Push master to origin/master was rejected by remote 解决&#xff1a; Settting--》Repository--》Protected Branches 中的Allowed to push设置为 Developers Masters

macos 下 vmware fusion 安装 vmware tools

在mac下安装过 vmware fusion , 然后装了个win7的虚拟机&#xff0c;装vmtools发现菜单是灰色的&#xff0c;没法直接装。印象中这个菜单是找到相应的光盘镜像并加载的功能。 然后在vmware fusiion 程序包里果然找到了&#xff0c;后工复制出来并加载它。在虚拟机里就能安装了…

jenkins配置git报错 failed to connect to repositary

解决办法&#xff1a;配置github/gitlab的SSH keys 1.在电脑目录下C:\Users\username\.ssh找到id_rsa.pub文件&#xff0c;将其中内容复制 如果没有该文件&#xff0c;则登录github/gitlab&#xff0c;进入个人设置&#xff0c;找到SSH and GPG keys,点击生成 2.登录github/gi…

成功解决urllib.error.URLError: <urlopen error [Errno 11001] getaddrinfo failed>

成功解决urllib.error.URLError: <urlopen error [Errno 11001] getaddrinfo failed> 目录 解决问题 解决思路 解决方法 解决问题 raise URLError(err) urllib.error.URLError: <urlopen error [Errno 11001] getaddrinfo failed> 解决思路 网址错误&#xff…

git解决ssh: Could not resolve hostname github: Name or service not known的问题

git解决ssh: Could not resolve hostname github: Name or service not known的问题 在使用Git上传代码到远程仓库时&#xff0c;走到git push origin master推送这一步的时候&#xff0c;可能某一天突然就会出现这样的错误&#xff1a; 碰到这种情况&#xff0c;第一种方法是…

新建Flutter项目无法导入FlutterActivity

新建Flutter项目之后进入到Android目录下打开MainActivity.kt文件会发现类文件的顶部在导包的时候出错&#xff0c;找不到FlutterActivity&#xff0c;就像下面这样 package com.example.flutter_app_2import io.flutter.embedding.android.FlutterActivityclass MainActivity…

解决爬虫错误:urllib.error.URLError: urlopen error [WinError 10060]

当用多线程爬取网站出现urlopen error [errno 10060]的错误&#xff0c;也就是连接失败。原因是多个线程爬去某个网站的数据&#xff0c;每次连接完需要sleep(1)一会&#xff0c;不然该网站服务端的防火墙会ban掉你的connect。睡眠等待机制会减少urlopen error [errno 10060]出…