环境

AS 3.1.4

情形

类中创建了一个继承自Application的类,并在AndroidManifest.xml注册。编译报错,提示"Suggestion: add ‘tools:replace=“android:name”’ to element at AndroidManifest.xml"

查找原因

通过网络搜索,找到android:icon,android:theme等相似问题的解决方法,确定问题原因是module中同样有一个继承自Application的类。

解决方法

AndroidManifest.xml的根标签下加上 xmlns:tools="http://schemas.android.com/tools",然后在application标签下加入tools:replace="android:name"。如下所示

<manifest xmlns:android="http://schemas.android.com/apk/res/android"         xmlns:tools="http://schemas.android.com/tools"         package="com.**">   <application android:name="com.**.App"                android:allowBackup="true"                android:icon="@mipmap/app_icon"                android:label="@string/app_name"                android:supportsRtl="true"                android:theme="@style/AppTheme"                tools:replace="android:name">   application>manifest>

更多相关文章

  1. android中include标签的使用
  2. 使用Android(安卓)Studio解决Android(安卓)65k问题
  3. Android中attr自定义属性详解
  4. 【Android】选项卡使用
  5. android 测试
  6. 【Android】application标签说明
  7. Android(安卓)studio 启动出现错误AAPT: error: resource androi
  8. android中application标签说明
  9. Android(安卓)layout布局属性、标签属性总结大全

随机推荐

  1. Android从服务端获取json解析显示在客户
  2. 心得分享:关于对Android的理解,知识点梳理
  3. Android数据存储方式(一)文件
  4. android(基于回调)的事件处理
  5. Android(安卓)Service 浅析(生命周期,启动
  6. Only the original thread that created
  7. android网络连接使用GET方式请求服务器时
  8. android的消息处理机制(图+源码分析)——Lo
  9. 你知道安卓和星巴克这些名字是怎么来的吗
  10. WordPress for Android(安卓)已更新到2.0