Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
michaelonz opened this issue Apr 27, 2024 · 1 comment
Closed

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

michaelonz opened this issue Apr 27, 2024 · 1 comment
Labels
area-single-project Splash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, Resizetizer platform/android 🤖 s/triaged Issue has been reviewed t/bug Something isn't working

Comments

@michaelonz
Copy link

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.

  • name: Setup .NET
    uses: actions/setup-dotnet@v4
    with:
    dotnet-version: 8.0.*

    • name: Install MAUI workload
      run: dotnet workload restore

    • name: install workload Android
      run: dotnet workload install android

    • name: install workload IOS
      run: dotnet workload install maui-ios

    • name: Restore Dependencies
      run: dotnet restore APP.sln

    • name: dotnet clean
      run: dotnet clean -f:net8.0-android -c:Release APP.sln

    • name: Build
      run: dotnet build -f:net8.0-android --no-incremental -c:Release APP.sln --artifacts-path \mybuild

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?
@michaelonz michaelonz added the t/bug Something isn't working label Apr 27, 2024
@Eilon Eilon added the area-single-project Splash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, Resizetizer label Apr 30, 2024
@Zhanglirong-Winnie Zhanglirong-Winnie added the s/triaged Issue has been reviewed label May 7, 2024
@jfversluis
Copy link
Member

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!

@jfversluis jfversluis closed this as not planned Won't fix, can't repro, duplicate, stale May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-single-project Splash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, Resizetizer platform/android 🤖 s/triaged Issue has been reviewed t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants