Home

versionCode

versionCode is an integer value used in Android app packaging to identify a specific build of an application. It is defined in the app’s manifest and is not shown to users. Each new release to users should have a higher versionCode than the previous one, making it possible for the system and app stores to distinguish newer builds from older ones.

The primary purpose of versionCode is internal versioning. The Android system uses it to determine whether

VersionCode is commonly configured in the build system. In the Android Gradle Plugin, it is set in

Best practices emphasize starting at a small integer (often 1) and increasing it with every release. Since

an
update
can
be
installed
over
an
existing
installation,
and
app
distribution
services
like
the
Google
Play
Store
use
it
to
decide
if
an
APK
or
app
bundle
represents
a
newer
version.
Unlike
versionCode,
the
user-facing
version
number
is
versionName,
which
is
a
string
such
as
"1.0"
and
is
displayed
to
users.
the
defaultConfig
block,
for
example:
versionCode
1;
versionName
"1.0".
Many
teams
automate
versionCode
increments
in
CI
pipelines
or
derive
them
from
the
date
or
commit
count
to
ensure
monotonic
increases
without
manual
updates.
versionCode
is
internal,
it
should
be
treated
as
a
strictly
increasing
build
identifier
rather
than
a
user-visible
metric.