The Build.gradle (Module:app) profile in Android Studio also sets its version number, and in the case of conflicts with the Androidmanifest.xml filled version number, the compiled APK uses Build.gradle ( MODULE:APP) inside the configuration:
Build.gradle (Module:app)
| 12345678910 |
compilesdkversion buildtoolsversion "21.1.2" defaultconfig { applicationid "cn.wangbaiyuan.translate" minsdkversion targetsdkversion versioncode 1 versionname "1.0" } |
Workaround
Locate the Build.gradle (Module:app) file under the project folder, delete both Versioncode and versionname in Defaultconfig, or modify the version number directly here.
--------------------------------------------------------------------------------------------------------------- --------------------------------------------------
The android:versioncode--integer value that represents the relative version of the application code, which is how many times the version has been updated.
Integer values are advantageous for other programs to compare and check for upgrades or downgrades. You can set this value to any value you want to set, but you have to make sure that the value of the subsequent update is larger than this. The system does not enforce this behavior, but as the version update value increases it is normal behavior.
In general, the first version of your program is set to Versioncode 1, and then each release will be incremented, regardless of whether the content is larger or smaller. This means that Android:versioncode is not displayed to the user like the release version of the application (see Android:versionname below). The application and the published service should not display this version value to the user.
android:versionname--A string value that represents the version information of the application and needs to be displayed to the user.
Like Android:versioncode, the system does not use this value for any internal purposes, except to display it to the user. The published service also needs to extract this value to display to the user.
ZZ Android version number, version code and version name