Are those artifacts in your local maven repo?

You shouldn't need to put @aar if the pom declares the packaging as aar
(which is true in your case).

However there is an issue right now with the maven local repo support in
Gradle that requires using @aar. Also it doesn't automatically follow
transitive dependencies so you'd need to do

   compile 'com.stubworld.core:CorelibAndroid:1.0@aar' {
      transitive = true
   }

This will be fixed in Gradle 1.11 and you won't need to add coreLibJava
manually or use @aar.



On Mon, Feb 3, 2014 at 7:15 PM, Traun Leyden <traun.ley...@gmail.com> wrote:

>
> I have a library that is split into two maven artifacts:
>
> 'com.stubworld.core:CorelibJava:1.0'
> 'com.stubworld.core:CorelibAndroid:1.0'
>
>
> The CorelibJava artifact is built by a build.gradle 
> script<https://friendpaste.com/A2cSMvGKJdSlaPUVZ6nVW>that uses the java 
> gradle plugin, and is pure java with no android
> dependencies.  The maven artifact is a jar and here is the pom 
> file<https://friendpaste.com/i0EBG4b0NJ5WEQK9pE6sF>
> .
>
> The CorelibAndroid artifact is built by a build.gradle 
> script<https://friendpaste.com/i0EBG4b0NJ5WEQK9pMVNi>that uses the 
> android-library gradle plugin, and depends on the CorelibJava
> maven artifact.  The maven artifact is an aar and here is the pom 
> file<https://friendpaste.com/A2cSMvGKJdSlaPUVZ6ojv>
> .
>
> I tried to use these libraries from an Android project which uses the
> 'android' gradle plugin, and after some tweaking I managed to get it to
> work with the following dependencies:
>
> dependencies {
>     compile 'com.android.support:appcompat-v7:+'
>     compile 'com.stubworld.core:CorelibJava:1.0'
>     compile 'com.stubworld.core:CorelibAndroid:1.0@aar'
> }
>
> However, I wasn't really clear on a few things:
>
> * Why do I specifically need to reference the 
> 'com.stubworld.core:CorelibJava:1.0'
> artifact?  Shouldn't that be automatically resolved since it's an upstream
> dependency of the  'com.stubworld.core:CorelibAndroid:1.0@aar' artifact?
>
> * Why is the @aar qualifier needed on the
> 'com.stubworld.core:CorelibAndroid:1.0@aar' artifact?  I have other
> projects that depend on .aar maven artifacts, and I never needed to add
> "@aar".
>
> Basically I expected the dependencies to look like this:
>
> dependencies {
>     compile 'com.android.support:appcompat-v7:+'
>     compile 'com.stubworld.core:CorelibAndroid:1.0'
> }
>
> and just want to make sure I'm doing things right.
>
> --
> 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 adt-dev+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Xavier Ducrohet
Android SDK Tech Lead
Google Inc.
http://developer.android.com | http://tools.android.com

Please do not send me questions directly. Thanks!

-- 
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 adt-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to