.NET for Android error APT2265

Issue

The tool aapt2 is unable to resolve one of the files it was passed. This is generally caused by non-ASCII characters in the project name or the path to the project.

Solution

The best way to avoid this is to ensure that your project does not contain non-ASCII characters. For example if you create all of your projects in folders such as

C:\Users\shëlly\Visual Studio 2022\Android\MyProjects\Com.SomeReallyLongCompanyName.MyBrillantApplication\MyBrilliantApplicaiton.Android\

you may well encounter problems with not only aapt2 but also Ahead of Time compilation. Keeping your project names and folder structures short, concise and ASCII will help work around these issues. For example instead of the above you could use

C:\Work\Android\MyBrilliantApp

Which is much shorter, contains no non-ASCII characters and much less likely to encounter issues.