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.93k stars 532 forks source link

AndroidManifest not found with custom configurations #9540

Open LeoJHarris opened 1 day ago

LeoJHarris commented 1 day ago

Description

I've waited nearly an hour on an android project to try publish a release build and its taken so long I gave up on it so posting my concern here. As this is my first attempt on a MAUI release build I cannot comment on previous versions.

Stuck on here:

Image

Steps to Reproduce

  1. Right click project
  2. Select Publish...
  3. Archive...

Link to public reproduction project repository

No response

Version with bug

9.0.10 SR1

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

No response

Did you find any workaround?

NO

Relevant log output

LeoJHarris commented 1 day ago

UPDATE:

Got this working through the command line by specifying both the framework and configuration https://github.com/dotnet/maui/discussions/24621.

I did initially get an error though through the command line though which was a bit more revealing then the VS GUI.

error XA1018: Specified AndroidManifest file does not exist: C:\xxxx\Platforms\Android\Release\AndroidManifest.xml.

I Resolved this by specifying the --configuration so my guess is perhaps because we use different configurations i.e. AndroidManifest files placed in certain directories, that it defaulted to a Release path although the issue I see here is that it did not honor the AndroidManifest path as defined in the .csproj file like the following

Platforms\Android\XXXXX\AndroidManifest.xml
jpobst commented 11 hours ago

Any issue(s) with the VS Archiving experience would be owned by the VS integration team who does not use GitHub for issue tracking.

Please use the tools available inside of VS to report this issue. This allows the issue to be routed to the correct team, and provides them the correct logs they need to diagnose it.


As for the command line error:

error XA1018: Specified AndroidManifest file does not exist: C:\xxxx\Platforms\Android\Release\AndroidManifest.xml.

@jonathanpeppers @dellis1972 Would this be expected if custom configurations are being used? Or do we possibly have a bug here?

jonathanpeppers commented 10 hours ago

It's hard to say without a build log, can you share a .binlog file that contains the error? https://aka.ms/binlog

In general, I would only use Debug and Release for your configuration names, as no one knows the full set of properties you would need to set to make a configuration such as DebugFoo or ReleaseFoo correct:

dotnet-policy-service[bot] commented 10 hours ago

Hi @LeoJHarris. We have added the "need-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.