赞
踩
导入某个第三方依赖后,出现label冲突
一般是项目中使用的第三方依赖库中的AndroidManifest.xml中跟当前App的AndroidManifest.xml中有重复的某些属性时AS会提示这个,按照提示添加就可以解决
以上蓝色框就是error错误给出的解决方案(很多时候,Android开发工具在异常处就已经提示的解决方案,仔细看就行)
(1)打开AndroidManifest.xml
(2)在Application内添加label冲突替换
tools:replace="android:label"
<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">
需要导入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标签的属性进行替换:
<activity
android:name=".XXXXXActivity"
android:screenOrientation="portrait"
tools:replace="screenOrientation" />
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。