Making Sense of the Architecture Components Versions
A new version of the Architecture Components was released today.
Well, OK, actually, three versions of the Architecture Components were released today.
Though, in truth, it’s more like the Architecture Components have undergone mitosis, with different component cells going their own way with respect to version numbers and versioning systems.
Confused yet?
“Iceberg, Right Ahead!”
When we depend upon artifacts like com.android.support:support-v4
or
android.arch.persistence.room:runtime:1.0.0-alpha9-1
, we perceive the
artifacts that show up in the dependencies
roster in our Gradle build files.
However, like an iceberg, we are only seeing a fraction of the actual artifacts,
with the rest being pulled in via transitive dependencies.
And, when it comes to Android libraries from Google, those transitive dependencies frequently are undocumented.
In general, that lack of documentation isn’t usually a problem. Sometimes it is, and it is the source of some of the confusion around today’s release(s).
Specifically, when we depend upon android.arch.lifecycle:runtime
,
there is a transitive dependency on android.arch.lifecycle:common
. And
android.arch.lifecycle:common
is undocumented.
So, What Went to 1.0.0?
The 1.0.0 Alpha 9-1 release notes state:
This is a major release where core lifecycle artifacts (runtime, common) and arch core (common) reach to stable version 1.0.0.
Exactly what reached “stable version 1.0.0” is undocumented, because the quoted passage refers to undocumented things.
Compounding the problem is that
the documentation
cites an artifact version (android.arch.lifecycle:runtime:1.0.0-alpha9-1
) that
does not exist, or at least is not being served by Google’s Maven repository.
(UPDATE 2017-09-15: fixed now, points to android.arch.lifecycle:runtime:1.0.0
)
The 26.1.0 support libraries (e.g., com.android.support:support-compat:26.1.0
)
depend upon android.arch.lifecycle:runtime:1.0.0
, which in turn depends
upon the undocumented android.arch.lifecycle:common:1.0.0
. So, those two
artifacts are at a stable 1.0.0 version.
Near as I can tell, nothing else of the “classic” Architecture Components
are at a 1.0.0 just yet. The artifacts that I tested all resolved to
a 1.0.0-alpha9-1
version. So, for example,
android.arch.lifecycle:extensions:1.0.0-alpha9-1
depends upon
android.arch.lifecycle:runtime:1.0.0
.
FWIW, there are also other undocumented artifacts, with disparate versions:
-
android.arch.core:common
, where the current version seems to be1.0.0
-
android.arch.core:runtime
, where the current version seems to be1.0.0-alpha9-1
These appear to be what the quoted passage refers to as “arch core”.
Enter Paging
The Architecture Components now have a new component:
Paging.
The release notes state that “Paging is released as alpha1
and will have its own release cycle.”
Indeed, android.arch.paging:runtime:1.0.0-alpha1
does exist. It, in turn,
depends upon an undocumented android.arch.paging:common:1.0.0-alpha1
. But, at
least those versions are in sync.
However, 1.0.0-alpha1
is not 1.0.0-alpha9
, nor is it 1.0.0
, so we have
three different version numbers within the same family of artifacts.
FWIW, android.arch.paging:runtime:1.0.0-alpha1
and
android.arch.paging:common:1.0.0-alpha1
depend upon a mishmash
of 1.0.0
and 1.0.0-alpha9-1
dependencies from other libraries.
In the fullness of time, this will all get cleared up, in all likelihood. For now, it’s more than a bit confusing, requiring rummaging through POM files to see what is going on.