I have this strange problem with my android studio, when I try to compile/run/build apk the androidCode and androidName always comes to version 1.0, no matter what I set it. I've been changing the main AndroidManifest.xml file, and still nothing. Does anyone else have this bug, or what have you done to fix it?
Asked
Active
Viewed 4,398 times
10
-
3Does your build.gradle have rules that override versionCode/versionName? – laalto Dec 24 '13 at 10:32
-
Yes, that was the culprit. – lawonga Dec 24 '13 at 22:26
2 Answers
14
It was build.gradle being the culprit, under android, you need to change the settings here:
defaultConfig {
minSdkVersion 9
targetSdkVersion 19
versionCode 2 <----This
versionName "1.1" <----This
}

lawonga
- 832
- 10
- 20
2
You need to change the android:versionCode and android:versionName in AndroidManifest, as shown below:
If Old is:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.hello"
android:versionCode="1"
android:versionName="1.0" >
Change it to:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.hello"
android:versionCode="2"
android:versionName="1.1" >

Infinite Recursion
- 6,511
- 28
- 39
- 51
-
@LalitPoptani: Thanks for the correction, it was a typo, edited answer – Infinite Recursion Dec 24 '13 at 10:44
-