Hi
tl;dr: Does an aar lib have to be in it's own maven artifact? Is there any
way to have an aar in the same artifact as the jar and have it work?
I have an Android library project and, up till now, I have been pushing jar
files to the Maven Central repository. For the latest release I have
pushed an .aar file as well for use by Android Studio users. So the MCR
contains the normal pom, jar, sources and javadocs file *plus* an aar. The
pom is for the jar, not the aar.
However when I try to test the aar file in a project, it doesn't work.
Android Studio only ever seems to pull down the jar version.
My apps build.gradle dependency clause looks like this:
dependencies {
compile 'com.mydomain:mylibrary:1.2.2-beta-1'
}
This loads the Jar file successfully. However I want it to use the aar
file because it contains a custom View class and I need access to the
resources.
Is there a way to force it to fetch the aar artifact? I've tried the @aar
trick:
dependencies {
compile 'com.mydomain:mylibrary:1.2.2-beta-1@aar'
}
and many other variations, but none have worked.
I know that if the artifact contains just the aar - and the POM reflects
that (ie. <pakaging>aar</packaging>) - it will work. But is that the only
solution? It seems like it would be nice if the artifact contained both
packagings. Rather than having to have a completely different artifact
name for the aar.
Paul
--
You received this message because you are subscribed to the Google Groups
"adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.