I was working on a Xamarin Android project and I was just editing a class file that can be edited by a user and then I tried to build like I have built a thousand times before without errors but this time this error was thrown Xamarin.Android.Legacy.targets(265, 5): [XA0111] Unsupported version of AAPT2 found at path 'C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Xamarin\Android'. Open the project file in a text editor and remove the 'Aapt2ToolPath' MSBuild property or ensure it is set to a valid location.
I thought the error was with that particular project and tried to create a new Xamarin Android project but then the same issue keeps recurring both in Visual Studio 2022 and Rider. Please help me save my projects by helping me get rid of this error.