Preface
Android Studio is an IDE developed by Google for Android developers. It supports Windows, Mac, Linux and other operating systems, and is built based on the popular Java language integrated development environment IntelliJ.
Discover problems
I encountered this problem when I needed to import third-party libraries when working on projects recently
Error:Execution failed for task ':app:processDebugManifest'. > Manifest merger failed : Attribute application@theme value=(@style/) from :21:9-52is also present at [MyChaass:mymusic:unspecified] :17:9-40 value=(@style/AppTheme).Suggestion: add'tools:replace="android:theme"' to <application> element at :15:5-37:19 to override.
The reason is that our main project will be defined by defaultandroid:icon=""
, when we introduce third-party libraries, it is also defined
When this label is used, this problem will occur if the two fail to merge.
Solution
The solution is<application>
Add in the tagtools:replace="android:icon"
.
First of all,<manifest>
Add a tools namespace to the tag:
xmlns:tools=/tools
The same problem also has theme, and the solution is also to increasetools:replace="android:theme"
,
However, when both merge fails, the middle should be separated by ",":
tools:replace="android:icon,android:theme"
manifest file:
<application android:allowBackup="true" android:icon="@mipmap/christ_icon" android:label="@string/app_name" android:supportsRtl="true" android:name=".App" tools:replace="android:icon,android:theme" // Just add this sentence android:theme="@style/"> </application>
Adding the above code can solve the problem.
Summarize
The above is the entire content of this article. I hope that the content of this article has certain reference value for everyone's study or work. If you have any questions, you can leave a message to communicate. Thank you for your support.