Commit b0f4dea
[Xamarin.Android.Build.Tasks] The "ConvertResourcesCases" task failed unexpectedly. (#1371)
Fixes? https://devdiv.visualstudio.com/DevDiv/_workitems/edit/571365
We have a report that `ConvertResourcesCases` is failing with the
following error:
error MSB4018: The "ConvertResourcesCases" task failed unexpectedly.
Android/Xamarin.Android.Common.targets(1334,2): error MSB4018: System.IO.FileNotFoundException: <some path>/design_layout_snackbar.xml.tmp does not exist
This is completely weird, especially as the Task is not being called
concurrently (or so we hope & assume). What I suspect is happening is
Visual Studio for Mac is running the `UpdateAndroidResources` target
at the same time the user started a build.
Because the name of the temp files was just `foo.xml.tmp` it is
highly possible that one instance of the task is deleting the file
while another instance is still running. This is difficult to
replicate.
Attempt to "fix" things by using `System.IO.Path.GetTempFileName()`
instead of appending `.tmp` to the filename. This should avoid
filename collisions.
However, if our suspicion is correct that the `UpdateAndroidResources`
target is concurrently executing alongside a Build, this patch will
*not* fix the concurrent target execution scenario.1 parent d8764e7 commit b0f4dea
File tree
3 files changed
+7
-9
lines changed- src/Xamarin.Android.Build.Tasks
- Tasks
- Utilities
3 files changed
+7
-9
lines changedLines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| |||
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
| 90 | + | |
90 | 91 | | |
91 | 92 | | |
92 | 93 | | |
93 | | - | |
| 94 | + | |
94 | 95 | | |
95 | 96 | | |
96 | 97 | | |
| |||
Lines changed: 2 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 19 | + | |
23 | 20 | | |
24 | 21 | | |
25 | 22 | | |
| |||
0 commit comments