dotnet / android

.NET for Android provides open-source bindings of the Android SDK for use with .NET managed languages such as C#
MIT License
1.93k stars 532 forks source link

Add check for java reserved works in AndroidResource items #9537

Open dellis1972 opened 20 hours ago

dellis1972 commented 20 hours ago

Context #9461

Some users are seeing the following error from aapt2.

APT2258 invalid symbol name 'com.companyname.mauiapp1:drawable/import'.
C:\Users*User\AppData\Local\Temp\2kevcthb.kih\com\companyname\mauiapp1\R.java*"

This is because import is a java reserved word. The aapt2 code generator is not taking that into account (like we do for C# designer.cs). As a result we get this error. Its not very helpful. So lets introduce a new error APT0004 which will explicitly check for java keywords in resource filenames. This will allow users to know why their build is failing.