dotnet / android

.NET for Android provides open-source bindings of the Android SDK for use with .NET managed languages such as C#
MIT License
1.92k stars 526 forks source link

Build fails of `$(AndroidManifest)` is an absolute path #9268

Open jonpryor opened 3 weeks ago

jonpryor commented 3 weeks ago

Android framework version

net8.0-android, net9.0-android

Affected platform version

All

Description

Context: https://developercommunity.visualstudio.com/t/Error-code---XA1018--Specified-AndroidMa/10728496

dotnet build fails if $(AndroidManifest) is an absolute path.

This is likely related to:

https://github.com/dotnet/android/blob/df68c208ad02d09ebb9e6a87053343985dfc1e36/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets#L572

Steps to Reproduce

% dotnet new android

# this works
% dotnet build *.csproj

# this fails
% dotnet build "-p:AndroidManifest=$(pwd)/AndroidManifest.xml" *.csproj
…
error XA1018: Specified AndroidManifest file does not exist: $(pwd)/$(pwd)/AndroidManifest.xml.

Did you find any workaround?

Don't use an absolute path in $(AndroidManifest).

Relevant log output

No response

jpobst commented 3 weeks ago

Related: https://github.com/dotnet/android/issues/7243