0

My Project was on flutter 2.5.3 and we decdied to upgrade code base to flutter latest version (3.7.3) . My version from pubspec.yaml used to be 1.2+10 after upgrading flutter. When I run flutter pub get or any other pub related command i am getting an error Invalid version number: Could not parse 1.2+10.

Here is pubspec.yaml enter image description here

Please help me fixing the issue. Thanks in advance :)

1 Answers1

1

To quote from the documentation:

A version number is three numbers separated by dots, like 1.2.43 followed by an optional build number separated by a +.

You only have two. So maybe change it to 1.2.0+10

Ivo
  • 18,659
  • 2
  • 23
  • 35
  • If I follow this convention it is showing different versions in android and ios. in ios the version is 1.2.10 in android verison is 1.2.0.10 I want both of them to be same and in the format shown for ios (1.2.10) – Velicheti Sowmitri Feb 14 '23 at 10:06
  • @VelichetiSowmitri that doesn't sound right. `1.2.0+10` should translate to both platforms as `1.2.0`. If you want `1.2.10` you should use as version `1.2.10+X` where X is the version code for android. This is a number of your choice that should be increased on each publish of your app. I'm also surprised that accoring to you `1.2+10` worked at some point because I think that never should have worked. Maybe you just had `1.2.10` before – Ivo Feb 14 '23 at 10:16
  • I used to use 1.2+10 and it worked for me from long back,(flutter v1 to v2.5) after upgrading to v3 It is not accepting the format – Velicheti Sowmitri Feb 14 '23 at 10:28
  • @VelichetiSowmitri ah okay, I didn't know that. I'm not sure then how to resolve your issue – Ivo Feb 14 '23 at 14:10