Manifest merger failed : Attribute application@icon value=(@mipmap/ic_launcher) from AndroidManifest
情况是这样子的,导入一个比较老的项目(两年前),它依赖于一个 Libraray,已经先导入了 library,现在导入项目的时候出了错
(1) Android Studio 目前提供将 SDK包成 .aar 档案格式的方式,此方式除了将 class 包入之外,也会将资源、图片等,都一起包入。而以前所使用的 .jar 只会将相关的 class 包入,所以在以前将资源文件一起导入有时候会出问题
(2) 所有的资源文件会被 merge 在一起,什么意思呢?就是如果你自己做的SDK中包了一個 layout 叫做 abc.xml,當有个 project 使用你的SDK,而且这个 project 也有一个 layout/abc.xml,在将你的 SDK include 到 project 以后,build 的过程中,SDK中的abc.xml會和 project 中的abc.xml合并(或是取代)。
(3) 因为(2)的原因,所有的 resource file name 或是 resource id 都记得加上 prefix 或是 postfix,用 darkwing_co_abc.xml 或是 abc_darkwing_co.xml 的方式命名。不会因为合并或取代造成未知的错误。
(4) 有时候在编译的时候,遇到 attribute 重复的情况会回报错误,eg:
Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute application@icon value=(@mipmap/ic_launcher) from AndroidManifest.xml:10:9-43
is also present at [com.pnikosis:materialish-progress:1.0] AndroidManifest.xml:13:9-45 value=(@drawable/ic_launcher)
Suggestion: add 'tools:replace="android:icon"' to element at AndroidManifest.xml:8:5-22:19 to override
这是因为 manifeast file 中某些 attribute 与 project 中的 minifeast 的 attribute 有重复,像是上面的例子,是说这两个地方都有 ic_launcher,所以编译器不知道用哪一个
这个时候可以指定下面的方式让编译器知道:
tools:replace=”android:icon,android:theme”
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="co.darkwing.bookingapp" >
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme_darkwing_co"
tools:replace="android:icon,android:theme">
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
注意, attribute 报错时候,什么报错就替换什么,我的 Theme 也报错了,替换之后无效,我就直接去掉一些Activity 的Theme,然后成功运行
原文:https://blog.csdn.net/u011033906/article/details/59577340
Manifest merger failed : Attribute application@icon value=(@mipmap/ic_launcher) from AndroidManifest的更多相关文章
- gradlew 命令行 build 调试 构建错误 Manifest merger failed MD
Markdown版本笔记 我的GitHub首页 我的博客 我的微信 我的邮箱 MyAndroidBlogs baiqiantao baiqiantao bqt20094 baiqiantao@sina ...
- AS报:Manifest merger failed with multiple errors, see logs
* What went wrong:Execution failed for task ':app:processDebugManifest'. Manifest merger failed with ...
- > Manifest merger failed with multiple errors, see logs -- Android Studio问题汇总
FAQ:> Manifest merger failed with multiple errors, see logs 解决: 此问题产生原因大概有三个 # 第一,清单文件有错,这种错不会在编译 ...
- 终极报错解决方案:Error:Execution failed for task ':app:processDebugManifest'. > Manifest merger failed with
遇到这个报错的时候,不要慌 Error:Execution failed for task ':app:processDebugManifest'. > Manifest merger fail ...
- Manifest merger failed : uses-sdk:minSdkVersion 9 cannot be smaller than version 10 declared in library
Error:Execution failed for task ':app:processDebugManifest'. > Manifest merger failed : uses-sdk: ...
- 错误:“Manifest merger failed with multiple errors, see logs”
今天用Android Studio打开以前写个的项目后,出现如下错误:Manifest merger failed with multiple errors, see logs 现象是: 遇到这个问 ...
- 解决『Manifest merger failed with multiple errors, see 』
Error:Execution failed for task ':app:processDebugManifest'.> Manifest merger failed with multipl ...
- android studio - Manifest merger failed with multiple errors, see logs
今天编译运行的时候遇到了“Error:Execution failed for task ':test:processDebugManifest'.> Manifest merger faile ...
- android开发里跳过的坑——android studio 错误Error:Execution failed for task ':processDebugManifest'. > Manifest merger failed with multiple errors, see logs
使用AS在gradle里配置了多个定制版本,发现在编译版本切换时,会出现错误: Error:Execution failed for task ':processDebugManifest'.> ...
随机推荐
- .net core中使用autofac进行IOC
.net Core中自带DI是非常简单轻量化的,但是如果批量注册就得扩展,下面使用反射进行批量注册的 public void AddAssembly(IServiceCollection servic ...
- 简述在ADO中使用接口的抽象数据提供程序以及ADO.NET数据提供程序工厂模型
如何在ADO中使用接口的抽象数据提供程序 在cofig中 appSettings下,配置数据连接类型 <appSettings> <!--这个键值映射到枚举值中的某个值--> ...
- 通过 Azure Pipelines 实现持续集成之docker容器化及自动化部署
通过 Azure Pipelines 实现持续集成之docker容器化及自动化部署 Intro Azure DevOps Pipeline 现在对于公开的项目完全免费,这对于开源项目来讲无疑是个巨大的 ...
- 【java】Freemarker 动态生成word(带图片表格)
1.添加freemarker.jar 到java项目. 2.新建word文档. 3.将文档另存为xml 格式. 4.将xml格式化后打开编辑(最好用notepad,有格式),找到需要替换的内容,将内容 ...
- 报错TypeError: $(...).live is not a function解决方法
报错的原因是这个方法在jquery1.7以后就被废除了, 1.7以后的版本改用.on()方法 之前的用法: .live(events, function) 新方法: .on(eventType, se ...
- 【转】网页禁止后退键BackSpace的JavaScript实现(兼容IE、Chrome、Firefox、Opera)
var forbidBackSpace = function (e) { // 获取event对象 var ev = e || window.event; // 获取事件源 var obj = ev. ...
- RuntimeException和Exception区别
1.java将所有的错误封装为一个对象,其根本父类为Throwable, Throwable有两个子类:Error和Exception. 2.Error是Throwable 的子类,用于指示合理的应用 ...
- Fix: Unable to terminate process ‘Access is denied’ 杀进程,关服务
https://appuals.com/fix-unable-to-terminate-process-access-is-denied/ 我 Process Hacker (方法3),成功杀掉: 阿 ...
- Java jar包启动脚本
#!/bin/bash APP_HOME=/wdcloud/app/rps/rps-module-admin APP_JAR=rps-module-admin-*.jar APP_PIDS=$(ps ...
- VS与Windbg调试
原文 : https://blog.csdn.net/fin86889003/article/details/20126593 原文 : https://blog.csdn.net/u014339 ...