How to solve "Your APK's version code needs to be higher than 2." in Google Play's Developer Console?

If you're directly using Gradle, or indirectly through Android Studio:

I fixed it by editing the version number inside of the build.gradle file! There is a small banner at the bottom of the android.manifest file that says "these changes are being overwritten by the build.gradle file."


enter image description here

Please see attached snap of Android Studio which should help.