異常問題解決Error:Execution failed for task ':app:processDebugManifest'


Error:Execution failed for task ':app:processDebugManifest'

www.MyException.Cn  網友分享於:2015-12-28  瀏覽:0次
 
Error:Execution failed for task ':app:processDebugManifest'.

D:\AndroidStudio\workSpace\A666\app\src\main\AndroidManifest.xml:13:9-27 Error:
 Attribute application@label value=(溜溜) from AndroidManifest.xml:13:9-27
 is also present at [A666:materialwidget:unspecified] AndroidManifest.xml:13:9-41 value=(@string/app_name)
 Suggestion: add 'tools:replace="android:label"' to <application> element at AndroidManifest.xml:9:5-31:19 to override
D:\AndroidStudio\workSpace\A666\app\src\main\AndroidManifest.xml Error:
 uses-sdk:minSdkVersion 15 cannot be smaller than version 16 declared in library [A666:materialwidget:unspecified] D:\AndroidStudio\workSpace\A666\app\build\intermediates\exploded-aar\A666\materialwidget\unspecified\AndroidManifest.xml
 Suggestion: use tools:overrideLibrary="com.csu.xy.materialwidget" to force usage


Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed with multiple errors, see logs

 

 

這個錯誤是我在使用了2個module之后出現的。

由於Gradle插件默認會啟用Manifest Merger Tool,若Library項目中manifest也定義了與主項目相同的屬性(例如默認生成的android:icon和android:theme),則此時會合並失敗,並報上面的錯誤。

 

解決方法

 

    在Manifest.xml的application標簽下添加tools:replace="android:icon, android:theme"(多個屬性用,隔開,並且記住在manifest根標簽上加入xmlns:tools="http://schemas.android.com/tools",否則會找不到namespace哦)而對於我這次的錯誤是只需要添加tools:replace="android:lable"就可以啦!

事實上logcat 已經教我如何糾正錯誤啦(上方紅色段落)所以碰到錯誤就直接分析logcat 吧,不能慌哦


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM