Skip to content

Conversation

@dellis1972
Copy link
Contributor

Fixes #6924

If the user moves the project to another location on the hard drive the build will fail with errors such as.

APT2126	file not found.	Foo.Foo	C:\Foo.Foo\obj\Debug\net6.0-android\lp\122\jl\res\values\attr.xml	1

To work around this we should place the $(MSBuildProjectFullPath) value in the _PropertyCacheItems ItemGroup. This will trigger a Clean if it changes.

Copy link
Member

@jonathanpeppers jonathanpeppers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like this idea, this also would fix: https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_workitems/edit/1591025

Can we add a test? Maybe just move a folder and make sure a bunch of targets run?

Minor nitpick: the title says "Clean", but it doesn't really run -t:Clean? Should we say "rerun all targets" instead?

@dellis1972 dellis1972 force-pushed the Issue6924 branch 3 times, most recently from b57f19c to 5292200 Compare November 1, 2022 12:42
@dellis1972 dellis1972 force-pushed the Issue6924 branch 3 times, most recently from fee5870 to b225cae Compare November 7, 2022 10:18
Fixes dotnet#6924

If the user moves the project to another location on the hard drive
the build will fail with errors such as.

```
APT2126	file not found.	Foo.Foo	C:\Foo.Foo\obj\Debug\net6.0-android\lp\122\jl\res\values\attr.xml	1
```

To work around this we should place the `$(MSBuildProjectFullPath)` value
in the `_PropertyCacheItems` ItemGroup. This will trigger a Clean if it
changes.
@dellis1972 dellis1972 merged commit 4500d7d into dotnet:main Nov 10, 2022
@dellis1972 dellis1972 deleted the Issue6924 branch November 10, 2022 15:20
grendello added a commit to grendello/xamarin-android that referenced this pull request Nov 14, 2022
* main:
  [ci] Enable CodeQL on nightly build (dotnet#7522)
  Bump to xamarin/Java.Interop/main@984711a (dotnet#7545)
  [Xamarin.Android.Build.Tasks] Timing.xml & `android:exported="true"` (dotnet#7551)
  [Xamarin.Android.Build.Tasks] run a Clean if the project path changes. (dotnet#7476)
@github-actions github-actions bot locked and limited conversation to collaborators Jan 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Android - APT2126 XML files not found when moving built project to a different path

2 participants