I get this error when uploading my app: Upload failed You need to use a different version code for your APK than version code 1

Viewed 535

I have an app on google play store. Currently there's only one upload.

And I want to upload a new version, but when ever I do that this error shows:

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

No matter weather it is versioncode 1, 2 or 3. The first release way versioncode 1, and this is versioncode 2.

I don't know what the problem is, maybe I have to sync the build.gradle, I've heard some ppl talk about that, but I am not 100% sure how to?

Also If I make a new 'App' and upload it there this error doesn't show op, that's probably because on that 'app' there's no other app-release with that name, or any with higher.

Also, there's like 300 different build.gradle files, the one I am talking about is the one under the directory

ApplicatioName\myApplication\build.gradle

Here is the build.gradle:

defaultConfig {
        applicationId "com.example.myapplication"
        minSdkVersion 16
        targetSdkVersion 30
        versionCode 2
        versionName "2.0"

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

What do I do?

1 Answers

In Flutter, at least in my experience, you don't need to modify version codes anywhere but in pubspec.yaml. Say your version tag there is version: 1.0.0+1, your android version code will be 1 and your user visible version name is 1.0.0. You can change this to version: 1.1.0+2, for example, and that should fix your problem.

Edit: And, obviously, rebuild.

Related