Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio APK not updating buildVersion

I'm trying to update an Android app and upload it to the play store, but I keep getting an error that it's using an old versionCode.

I've updated the versionCode parameter in my build.gradle file, but when I run build signed Bundle/APK I notice that the data of the APK is never updated.

I'm not overly familiar with Android Studio - primarily coming from an iOS background, but as far as I can tell this should be all that's needed?

There are no build errors or warnings, and I'm using the "locate" prompt from within Android Studio itself to find the build so I'm not sure what's going on.

I'm using Android Studio version 3.2.1 and it's the latest build as confirmed by check for updates.

defaultConfig {
    applicationId "com.example.app"
    minSdkVersion 19
    targetSdkVersion 27
    versionCode 5
    versionName "1.4"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

I've tried restarting Android Studio and cleaning the build, but neither has worked, I've always hit the 'sync gradle file' as well after making a change

like image 703
TommyBs Avatar asked Dec 07 '25 03:12

TommyBs


1 Answers

  1. Press Ctrl + Alt + Shift + S in Android Studio.
  2. app -> Flavors -> defaultConfig -> versionCode (Increment the version number).
  3. Click OK to trigger the Gradle build.
  4. Generate the Android App Bundle and check.

Product Structure Window Gradle Build


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!