'Xamarin "_AndroidXJetifyEmbeddedFiles" Build Error Visual Studio 2019

Whenever I try to build and run my mobile project the error

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1166,2): error MSB4057: The target "_AndroidXJetifyEmbeddedFiles" does not exist in the project.

Even when I create a new xamarin project and run it with the default code, I get the same error. Visual Studios is up to date so I am not sure what the problem could be.



Solution 1:[1]

I solved this issue by posting on Xamarin-Android's GitHub issue tracker See here...

You should try to delete %userprofile%\.nuget\packages\xamarin.androidx.migration and to compile you app again. It worked fine for me.

Solution 2:[2]

You can try the following methods:

1.update your nuget to the latest version and then delete bin and obj folders and try again;

2.Check if you have set up the Android SDK for Xamarin.Android correctly. Check document: https://docs.microsoft.com/en-us/xamarin/android/get-started/installation/android-sdk?tabs=windows

3.If the problem persists,try to repair your visual studio; For more details, please check:https://docs.microsoft.com/en-us/visualstudio/install/repair-visual-studio?view=vs-2019;

4.If the problem persists?you can try to perform a thorough uninstall for Xamarin for Visual Studio, and install the latest Visual Studio;

Solution 3:[3]

Today when i update a old project to Xamarin.Form5, i get this bug. I try to update all nuget, but still show this bug, when i see Warning, i see have a nuget downgrade because two nuget reference conflict. I delete one nuget that i not use, Build success.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ZipGenius
Solution 2 Jessie Zhang -MSFT
Solution 3 yangzhou