Reputation: 51
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
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.
Upvotes: 2
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