lawonga
lawonga

Reputation: 842

versionCode/versionName bug

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?

Upvotes: 10

Views: 4922

Answers (3)

Manish Kumar
Manish Kumar

Reputation: 1

VersionCode: 3100

VersionName: 6.0.0

ColorOS Version: UNKNOW

Mobile MODEL: RMX1911

Android Version: 10

Android AΡΙ: 29

getNetworkTypeName: mobile

WindowWidth And WindowHeight: 720*1456

WindowDensity:2.0

System's currenTimeMillis: 1715520224958

TimeZone:

libcore.util.ZoneInfo[id="Asia/Kolkata", mRawOffset=

Upvotes: 0

lawonga
lawonga

Reputation: 842

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
}

Upvotes: 15

Infinite Recursion
Infinite Recursion

Reputation: 6557

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" >

Upvotes: 2

Related Questions