Laurent
Laurent

Reputation: 1584

Android manifest not updating app version from Gradle build

Based on this Google document I'm expecting Gradle to update my manifest.xml file with a version number, notably this quoted section:

The defaultConfig element configures core settings and entries in the manifest file (AndroidManifest.xml) dynamically from the build system. The values in defaultConfig override those in the manifest file.

However when I change the version code or version name of my Gradle file, the values arent' changed in my manifest.

Upvotes: 3

Views: 2786

Answers (2)

Debasish Mitra
Debasish Mitra

Reputation: 1535

I have versionCode(1.0.3) and versionName(8) in my build.gradle only and it had worked correctly for me in past.

Now I updated the versionCode to 1.0.4 and versionName to 1 but it kept on giving me error on Google play. I even tried adding the new versionCode and versionName to AndroidManifest.xml but it did not help. Only thing that worked was updating the versionName to a higher number (9). Something seems broken in the Google Play upload apk and verify mechanism. Hopefully my answer would save someone else's 1 hour for solving this silly bug.

Upvotes: 2

Chandru
Chandru

Reputation: 5962

Even I am facing the similar issue. It is the default behaviour of gradle system I guess. You need to update both AndroidManifest.xml and build.gradle seperately if there is any changes in sdk versions, version code, version name,etc. I am looking forward that these kinda issues must be fixed in upcoming releases.

Upvotes: 2

Related Questions