Skip to content

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

Description

@jonpryor

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:

<_AndroidManifestAbs Condition=" '$(AndroidManifest)' != '' ">$(ProjectDir)$(AndroidManifest)</_AndroidManifestAbs>

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

Metadata

Metadata

Labels

Area: App+Library BuildIssues when building Library projects or Application projects.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions