The android library is a aar and the java library is a jar. Technically speaking both are jars, but their structural composition is slightly different from one another. For example an aar look like this:
res <android resources dir>
values
AndroidManifest.xml
classes.jar
<classpath structure>
<.class's>
R.txt
The java library looks like this:
<classpath structure>
<.class's>
META-INF
As mentioned, the java library cannot include any android resources such as layouts, values, colors, styles. An android library can include android resources, but it cannot contain any raw android assets (i.e. anything you put in the assets folder) It is also the developer's responsibility that resource names don't collide with one another. The android developers recommendation is that you assign unique prefixes for your resource names in each android library. Java libraries cannot reference any android SDK classes such as android.content.Context, etc.) There are some tricks you could do to get around that last restriction, but that involves transforming an aar into a jar. This could be done, as long as you're not using any android resources in the aar. The reason one might want to do that transformation is so you can have a "compileOnly" dependency. Currently, you cannot have a compileOnly dependency on an aar library, but you can on a jar library. This technique is used by OSGI application developers who need to reference interfaces that contain android SDK classes. There is an outstanding request to the android developer's team to modify this compilieOnly restriction.