dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
21.63k stars 1.62k forks source link

Building app on github actions is not updating AndroidManifest.xml #22091

Closed michaelonz closed 4 days ago

michaelonz commented 2 weeks ago

Description

I am using github actions to publish an app to google play and it is consistently failing with the following error when i send it to the play store. "Error: Version code 194 has already been used."

This is because the androidmanifest is not being updated when i build using the commandline on github. I have verified this by downloading the .aab file and opening the manifest inside - it is using the old version # still (194) - the new version is 195 but the build ignores it because the android manifest is not being updated during the build from platforms\android\androidmanifest.xml

NOTE: If i build from inside visual studio it works fine. If I build from the commandline on windows dev pc (not github) then it also works - eg I can open the aab file and confirm the version has updated.

NOTE: I am only building for android (at this stage) but if i dont do the workload restore for IOS then github also throws an error on that.

Below is the first part of the script (.yml) that i am using to kick off the build process.

Steps to Reproduce

Kick of the build script from github actions.

Link to public reproduction project repository

No response

Version with bug

8.0.20 SR4

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

all i assume

Did you find any workaround?

no - at this stage I cant publish my app

Relevant log output

NOTE: I do have a log file but it has some keys in it so I am happy to email it to microsoft privately - but don't want it on the public website.
Once this is allocated to someone i can email it JohnathonPeppers is probably best bet with this?
jfversluis commented 4 days ago

If you are using the single project approach then there probably is a version number in the csproj file of your project that you want to update instead of the one in the Android manifest file. It might get overridden if you update that directly.

Otherwise it is pretty hard to tell what might be the cause of this without seeing logs of your exact GitHub Action script.

I do feel that this is not necessarily something that is an issue in .NET MAUI or originates here, else we would've heard more about this. Feel free to contact me directly through email (find it on my GitHub profile) and we'll see if we can figure it out there.

If it turns out to be something on our side I'll open a new issue or update this one with the details.

Thanks!