Skip to content

Commit 6768c73

Browse files
authored
[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.
1 parent 1aa0ea7 commit 6768c73

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • src/Xamarin.Android.Build.Tasks/Tasks

src/Xamarin.Android.Build.Tasks/Tasks/Aapt2.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ static string GetErrorCode (string message)
493493
Tuple.Create ("APT2261", "file failed to compile"),
494494
Tuple.Create ("APT2262", "unexpected element <activity> found in <manifest>"),
495495
Tuple.Create ("APT2263", "found in <manifest>"), // unexpected element <xxxxx> found in <manifest>
496-
Tuple.Create ("APT2264", "The system cannot find the file specified. (2).") // Windows Long Path error from aapt2
496+
Tuple.Create ("APT2264", "The system cannot find the file specified. (2)") // Windows Long Path error from aapt2
497497
};
498498
}
499499
}

0 commit comments

Comments
 (0)