Skip to content

AndroidManifest not found with custom configurations #9540

Open

Description

@LeoJHarris

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

Activity

  1. LeoJHarris commented on Nov 21, 2024

    @LeoJHarris
    Author

    UPDATE:

    Got this working through the command line by specifying both the framework and configuration dotnet/maui#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
    
  2. transferred this issue fromdotnet/mauion Nov 21, 2024
  3. jpobst commented on Nov 21, 2024

    @jpobst
    Contributor

    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?

  4. added
    Area: App+Library BuildIssues when building Library projects or Application projects.
    and removed
    needs-triageIssues that need to be assigned.
    on Nov 21, 2024
  5. changed the title [-]Android Publishing Gets Stuck on Archiving[/-] [+]AndroidManifest not found with custom configurations[/+] on Nov 21, 2024
  6. jonathanpeppers commented on Nov 21, 2024

    @jonathanpeppers
    Member

    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:

  7. LeoJHarris commented on Nov 25, 2024

    @LeoJHarris
    Author

    @jonathanpeppers We do something like the following to get the full set of properties depending on the Constants defined.

    <PropertyGroup Condition="'$(Configuration)'=='ReleaseFoo'">
    	<DefineConstants>FOO;RELEASE;</DefineConstants>
    </PropertyGroup>
    
    <Choose>
    	<When Condition="$(DefineConstants.Contains('FOO'))">
                    <PropertyGroup Condition="'$(TargetFramework)' == 'net8.0-android'">
                    	<AndroidManifest>Platforms\Android\FOO\AndroidManifest.xml</AndroidManifest>
                    </PropertyGroup>
            </When>
    <Otherwise>

    Also, I have the MSBuild_Logs folder, is there a particular .binlog file you would like or the entire folder? To avoid exposing sensitive information should I share this with you directly?

  8. added
    need-attentionA xamarin-android contributor needs to review
    and removed
    need-infoIssues that need more information from the author.
    on Nov 25, 2024
  9. jonathanpeppers commented on Dec 2, 2024

    @jonathanpeppers
    Member

    You can share with my email on my Github repo if you like. Can you just use Configuration=Release for everything? And then invent a new property like -p:Foo=true to make changes for a special build?

  10. LeoJHarris commented on Dec 11, 2024

    @LeoJHarris
    Author

    @jonathanpeppers Maybe but I don't see how that's a whole lot different to specifying as a configuration i.e. Configuration=CustomFoo vs -p:BuildFlavor=CustomFoo and correct if I am wrong but I lose the benefit of the DefineConstants when switching between the configurations.

  11. LeoJHarris commented on Dec 11, 2024

    @LeoJHarris
    Author

    @jonathanpeppers correction I might have confused myself here, what your saying here is I can just use the custom property -p for selecting the correct signing identities and the manifests/info.plist files?

  12. jonathanpeppers commented on Dec 11, 2024

    @jonathanpeppers
    Member

    Yes, using any property other than $(Configuration) would work. Otherwise you would need to review a .binlog from a build to discover the set of properties for a Debug-like configuration vs a Release-like one. No one really knows the full list as noted in the dotnet/sdk issue above.

  13. LeoJHarris commented on Dec 11, 2024

    @LeoJHarris
    Author

    As of now I can do the publishing via the cmd line without any issues by explicitly specifying the config, as I'm a little snowed under other things including wrapping up our migration Ill try revisit this again later and if this becomes an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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