Commit 37a1758
authored
[Xamarin.Android.Build.Tasks] Improve aapt2+file not found handling (#7644)
Context: #7639
If a project has a long path name, this can cause `aapt2` to fail:
error APT2000: The system cannot find the file specified. (2).
This is not very helpful since there is no obvious reason to the user
as to *why* the build is failing.
We should do better. We *can* do better.
Catch this specific error message and report a helpful, actionable
message instead.
error APT2264: This is probably caused by the project exceeding the Windows maximum path length limitation.
See https://learn.microsoft.com/xamarin/android/errors-and-warnings/apt2264 for details.
In this case we will advise the user that the path is probably too
long and they should consult the documentation on how to resolve it.
The documentation includes a number of options for resolutions, so it
should cover all use cases. Generally these are:
1. Move the project closer to the root of the drive.
2. Enable long path support in windows.
3. Make changes to the `$(BaseIntermediateOutputPath)` MSBuild
property to move only the `obj` folder closer to the drive root.
Most users can get away with (1), though with Maui and Blazor based
apps this might not solve the problem as the project itself might
have a deep folder structure. Options (2) and (3) are available to
cover those scenarios.1 parent fc34ead commit 37a1758
File tree
5 files changed
+91
-3
lines changed- Documentation/guides/messages
- src/Xamarin.Android.Build.Tasks
- Properties
- Tasks
5 files changed
+91
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
530 | 530 | | |
531 | 531 | | |
532 | 532 | | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
533 | 537 | | |
534 | 538 | | |
535 | 539 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
| 191 | + | |
191 | 192 | | |
192 | | - | |
| 193 | + | |
193 | 194 | | |
194 | | - | |
| 195 | + | |
195 | 196 | | |
196 | 197 | | |
197 | 198 | | |
198 | 199 | | |
199 | 200 | | |
200 | 201 | | |
201 | | - | |
| 202 | + | |
| 203 | + | |
202 | 204 | | |
203 | 205 | | |
204 | 206 | | |
205 | 207 | | |
206 | 208 | | |
207 | 209 | | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
208 | 223 | | |
209 | 224 | | |
210 | 225 | | |
| |||
478 | 493 | | |
479 | 494 | | |
480 | 495 | | |
| 496 | + | |
481 | 497 | | |
482 | 498 | | |
483 | 499 | | |
0 commit comments