question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Versioning my Maui Android App raise multiple errors

See original GitHub issue

Description

Previously the way to define version code for Android in Maui .csproj file was like this:

<!-- Versions -->
<ApplicationVersion>3.1.2</ApplicationVersion>
<AndroidVersionCode>3</AndroidVersionCode>

With the new release of Visual Studio Preview, this has changed to:

<ApplicationVersion>3</ApplicationVersion>

It works, from Visual Studio, I can bundle a new .aab package (see image below). We see the version code is defined to 3. Unfortunately the version is defined to 1.0.0.

Bronzato_0-1638270460170

…when imported on the Google Play Console, it look like this: Bronzato_2-1638270667736

Unfortunately, when imported on the Google Play Console I only see the versionCode 3 (which is defined in the .csproj file as ApplicationVersion). What about the versionName (in parentheses) ? Nothing is planned in the .csproj file ? When imported on the Google Play Console, I don’t want to have 3 (1.0.0) but I want 3 (3.1.2)…

https://developer.android.com/studio/publish/versioning

versionCode — A positive integer used as an internal version number. versionName — A string used as the version number shown to users.

Someone suggested me to update my csproj file by adding: <ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>

or manually set in your androidmanifest.xml: https://github.com/xamarin/xamarin-android/blob/main/Documentation/guides/OneDotNetSingleProject.md

By adjusting my csproj file to add ApplicationDisplayVersion it raise me multiple errors:

image

Is this a bug ?

As soon as I remove this code in my csproj file, the errors disappeared.

I’m using Visual Studio Professional 2022 - Preview Version 17.1.0 Preview 1.1

I did a maui-check

Steps to Reproduce

By adjusting my csproj file to add ApplicationDisplayVersion it raise me multiple errors:

image

Version with bug

Visual Studio Professional 2022 - Preview Version 17.1.0 Preview 1.1

Maui Preview 10

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

OS: Windows 10 - Visual Studio Professional 2022 - Preview Version 17.1.0 Preview 1.1

Did you find any workaround?

Manually set inside my AndroidManifest.xml do the trick.

image

Bronzato_2-1638636605253

Relevant log output

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
SilverioMirandacommented, Jan 10, 2022

Same problem here

1reaction
zetaFairlightcommented, Apr 26, 2022

I have VS 2022 RC, and in a MAUI new app by simply changing the version number in the project file, it creates fatal errors. How to replicate the bug: Change from 1.0 to 0.1 <ApplicationDisplayVersion>0.1</ApplicationDisplayVersion>

The error in this case was: Error NETSDK1005 Assets file ‘C:\Users\Pablo\source\repos\Test1\Test1\obj\project.assets.json’ doesn’t have a target for ‘net6.0-windows10.0.19041’. Ensure that restore has run and that you have included ‘net6.0-windows10.0.19041’ in the TargetFrameworks for your project.

2022-04-25 21_02_12-Test1 - Microsoft Visual Studio Preview 2022-04-25 21_02_40-Test1 - Microsoft Visual Studio Preview

Read more comments on GitHub >

github_iconTop Results From Across the Web

Versioning my Maui Android App
Versioning my Maui Android App ... It works, from Visual Studio, I can bundle a new .aab package (see image below). We see...
Read more >
Building MAUI Android Failing
I created a brand new MAUI app (I had to create a new app as the previous app I'd created with a preview...
Read more >
Automatic build versioning - Codemagic Docs
You'll need to devise a build versioning strategy that satisfies the App Store and/or Google Play Store versioning requirements and works for your...
Read more >
Visual Studio fails after upgradeing to 17.1.1.
I was running Visual Studio 2022 ~17.0.6, then decided to update to 17.1.1. The upgrade process appeared normal and seemed to be successful....
Read more >
Monogame With Xamarin or Maui (IOS /Android) - ...
Hi, Has anyone ever worked with monogame on Xmarin.form or Maui? for IOS and Android projects? Does anyone have a starter example? thanks...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found