Android manifest doesn't update app version from Gradle build

Based on this google doc , I expect Gradle to update the manifest.xml file with the version number, especially in 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.

  • Is this normal behavior?
  • What are the values, between the manifest and the Gradle construct, are version codes and stting names?
  • How can I make the connection between the manifest versions and the Gradle construct more visible?
+3


source to share


2 answers


Even I faced a similar problem. I think this is the default behavior on gradle system. You need to upgrade both AndroidManifest.xml

and build.gradle

separately if there are any changes in sdk versions, code version, version name, etc. I look forward to seeing these curious issues fixed in future releases.



+2


source


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



Now I updated versionCode to 1.0.4 and versionName to 1, but it kept giving me google play error. I even tried to add new version code and versionName to AndroidManifest.xml but it didn't help. The only thing that worked was updating versionName to a larger number (9). Something seems to be broken in the Google Play download API and validation. Hope my answer saves someone another 1 hour to solve this stupid error.

+2


source







All Articles