I have the same problem with maven. The trick is to include the shared library only in the host application, and not include it in the plugin.
here is part of my projects.
pom shared library
build it as an andriod library (using apklib packaging) and install an additional jar file with build-helper-maven-plugin
<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>build-helper-maven-plugin</artifactId> <version>1.7</version> <executions> <execution> <id>attach-artifacts</id> <phase>package</phase> <goals> <goal>attach-artifact</goal> </goals> <configuration> <artifacts> <artifact> <file>${basedir}/target/${project.build.finalName}.jar</file> <type>jar</type> </artifact> </artifacts> </configuration> </execution> </executions> </plugin>
host-application pom include shared library dependency
<dependency> <groupId>group.id</groupId> <artifactId>artifact-id</artifactId> <version>common-library-version</version> <type>apklib</type> </dependency>
pom plugin use .jar dependency with scope provided. Apklib dependency does not support the provided scope.
<dependency> <groupId>your.common.library.group</groupId> <artifactId>Your-common-lib-id</artifactId> <version>your-common-lib-version</version> <scope>provided</scope> </dependency>
Finaly create some kind of assembler project and include all three projects in the pom file.
It works great for me with maven3 and Android-maven-plugin 3.2.0
alekz source share