When compile my Xamarin Forms Android application, visual studio, show me an error's list of AndroidManifest.xml conflict, for example:
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(3,3): Error AMM0000: is also present at AndroidManifest.xml:14:9-41 value=(@string/app_name). (AMM0000)
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(3,3): Error AMM0000: Suggestion: add 'tools:replace="android:label"' to <application> element at AndroidManifest.xml:19:3-79:17 to override. (AMM0000)
So i open AndroidManifest.xml from debug folder, replace with tools:replace into application tag, add tools schema into manifest tag, save it, recompile my application and it run without error.
But WHENEVER i compile my Xamarin Forms Android application, must follow previous steps MANUALLY.
I also add <AndroidManifestMerger>manifestmerger.jar</AndroidManifestMerger>
, into my Android .csproj
This issue is showed into DEBUG and RELEASE mode!!
Environment
This is an issue with Xamarin Forms 4.6.0.967 and above. To me, it was provoked by using the Honeywell.BarcodeReader NuGet package.
Some AndroidX packages were overwriting the default Xamarin (soon to be legacy) manifest merger with the manifestmerger.jar.
A workaround is to downgrade to Xamarin Forms 4.6.0.847, or to modify your AndroidManifest.xml to have an application element like this:
<application android:label="@string/app_name" tools:replace="android:label" ...
or if there are more conflicts:
<application android:label="@string/app_name" tools:node="replace"...
You will also need to add the following namespace to the manifest as an attribute:
xmlns:tools="http://schemas.android.com/tools"
Try cleaning and rebuilding your solution.
Build > Clean Solution
Build > Rebuild Solution
It worked for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With