Manifest merger failed : Attribute application@label value=(@string/app_name)

原文地址:http://blog.csdn.net/goodmentc/article/details/51088621


使用android studio开发过程中,新建了A、B两个工程,其中B是库工程,工程A引用库工程B,编译过程中出现:Manifest merger failed : Attribute application@label value=(@string/app_name),从log看,导致该错误的原因是工程A和工程B中的AndroidManifest.xml文件中都使用了app name,合并manifest的过程出现了问题。

根据studio的suggestion:在A工程中的AndroidManifest.xml中加上以下两行:

xmlns:tools="http://schemas.android.com/tools"
tools:replace="android:label"
下面是A工程的AndroidManifest.xml片段:

[java]  view plain  copy
  1. <?xml version="1.0" encoding="utf-8"?>  
  2. <manifest  
  3.     xmlns:android="http://schemas.android.com/apk/res/android"  
  4.     xmlns:tools="http://schemas.android.com/tools"  
  5.     package="com.xx.xx"  
  6.     android:versionCode="74"  
  7.     android:versionName="v3.4.1.1604071200" >  
  8.   
  9.    <uses-sdk android:minSdkVersion="9" android:targetSdkVersion="19"/>  
  10.     <application  
  11.         android:name="com.tc.cloud.McldApp"  
  12.         android:persistent="true"  
  13.         android:theme="@android:style/Theme.NoTitleBar"  
  14.         android:icon="@drawable/icon"  
  15.         android:allowBackup="false"  
  16.         android:supportsRtl="true"  
  17.         android:label="@string/mcs_app_name"  
  18.         tools:replace="android:label"  

B工程的AndroidManifest.xml片段:
 
[java]  view plain  copy
  1. <manifest xmlns:android="http://schemas.android.com/apk/res/android"  
  2.     package="xx.xx.mylibrary">  
  3.   
  4.     <application  
  5.         android:allowBackup="false"  
  6.         android:label="@string/app_name"  
  7.         android:supportsRtl="true">  
  8.   
  9.     </application>  
  10.   
  11. </manifest>  



重新编译后,错误消失。 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值