mechbullGT
mechbullGT

Reputation: 51

In Flutter pubspec.yaml file updated the version to 1.1.0+3 but on uploading to playConsole, still error version code 1

I've tried to upload an updated aab to the playConsole for my application but have got the following error:

Upload failed You need to use a different version code for your APK or
Android App Bundle because you already have one with version code 1.

I've tried to update the version code to 3 in the pubspec.yaml but I'm still getting the same version after uploading the latest generated aab/apk.

Upvotes: 3

Views: 1338

Answers (2)

mechbullGT
mechbullGT

Reputation: 51

Finally resolved it!

The issue was with the android/local.properties file which was not getting updated. I manually updated the version code here and got around the problem.

enter image description here

Upvotes: 2

Isak dl
Isak dl

Reputation: 577

Did you try to do a flutter clean before building the second time? The previous build might have been cached.

Other then that, check your android/app/build.gradle file there should be something like this there that sets the version:

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0'
}

Upvotes: 1

Related Questions