From 6768c731d327c8148c45304c895ca8987a9cc2f1 Mon Sep 17 00:00:00 2001 From: Dean Ellis Date: Wed, 23 Aug 2023 12:34:54 +0100 Subject: [PATCH] [Xamarin.Android.Build.Tasks] Fix APT2264 error on Windows. (#8289) We see users reporting the following error on Windows machines. APT2000 The system cannot find the file specified. (2): foo.xml This is odd because what it *should* be reporting an APT2264 error. This provides additional feedback to check for Long File Paths. As a result users do not get the additional info. It turns out that `aapt2` generates subtly different error messages between Linux/macOS and Windows, replacing a `.` with `:`. * Linux/macOS: The system cannot find the file specified. (2). * Windows The system cannot find the file specified. (2): Because our APT2264-checking code included the trailing `.` and Windows instead had a trailing `:`, we would *never* return APT2264 on Windows. Lets fix that by removing the trailing `.` from what we look for. --- src/Xamarin.Android.Build.Tasks/Tasks/Aapt2.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/Aapt2.cs b/src/Xamarin.Android.Build.Tasks/Tasks/Aapt2.cs index 270cba59190..e411b66e61e 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/Aapt2.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/Aapt2.cs @@ -493,7 +493,7 @@ static string GetErrorCode (string message) Tuple.Create ("APT2261", "file failed to compile"), Tuple.Create ("APT2262", "unexpected element found in "), Tuple.Create ("APT2263", "found in "), // unexpected element found in - Tuple.Create ("APT2264", "The system cannot find the file specified. (2).") // Windows Long Path error from aapt2 + Tuple.Create ("APT2264", "The system cannot find the file specified. (2)") // Windows Long Path error from aapt2 }; } }