Gradle release build has incorrect version

Hello, I am new to Gradle and I’m asking for help.

Long story short, my versioning was working well through app level build.gradle.kts file, where I was changing the version from 2 to 3:

    versionCode = 3
    versionName = "3"

Then, because I am keeping my gradle files in the same git repo as web app etc., I decided to rename the app folder to “android” and change the following in my project level settings.gradle.kts:

include(“:android”)

Since then, all my builds are generated with an old versionCode (2) and versionName (2), despite that I have changed those to 3 in the build.gradle.kts file. I have even tried adding the version into the AndroidManifest.xml file:

android:versionCode="3"
android:versionName="3"

Did not work.

So, I have renamed the android folder back to “app” folder, and changed back the following in my project level settings.gradle.kts file:

include(“:app”)

But, no matter what I do, the versionCode and versionName is always 2.

I even deleted the cache of Gradle. What should I do?