Android Studio tools:replace的使用

一般是项目中使用的第三方依赖库中的AndroidManifest.xml中跟当前app的AndroidManifest.xml中有重复的某些属性时AS会提示这个,其实你按照他的提示添加就可以解决了,这里只是记录一下。

如三方的依赖中application标签添加了android:theme, android:label可以在当前app中添加:

<application
        android:name=".App"
        android:allowBackup="true"
        android:icon="@drawable/app_icon"
        android:label="@string/app_name"
        android:theme="@style/AppTheme"
        tools:replace="android:theme, android:label">

 
需要导入tools命名:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:tools="http://schemas.android.com/tools"
          package="com.bcoder.app">

 
也可以对activity标签的属性进行替换:

<activity
    android:name=".CaptureActivity"
    android:screenOrientation="portrait"
    tools:replace="screenOrientation" />

 

上一篇:react和material-ui基础概念


下一篇:带你读《企业数字化基石-阿里巴巴云计算基础设施实践》第二章TOC建模2.1静态TCO模型(二)