By appending the artifact packaging, you are telling Gradle's resolver to skip looking at the pom.xml that defines the metadata for the artifact. This metadata includes the default packaging (in this case, aar) and more importantly it also includes information on dependencies which are resolved transitively by default.
In your case, when you incorrectly explicitly include the packaging in the dependency (the "@aar" part), you are not getting AppCompat's dependency on the support-v4 library. You almost never want to specify explicit packaging. On Thu Feb 19 2015 at 1:45:43 PM Tomáš Procházka <tomas.procha...@gmail.com> wrote: > I'm confused. What is difference between > > dependencies { > compile 'com.android.support:appcompat-v7:21.0.3@aar' > } > > and > > dependencies { > compile 'com.android.support:appcompat-v7:21.0.3' > } > > I thinked that if I skip @aar gradle will tray to use jar dependency, but > appcompat doesn't have jar type, only aar. > So I'm using @aar, but it doesn't work sometimes, for example here > > > https://github.com/avast/android-styled-dialogs/blob/master/library/build.gradle#L22 > > If I add @arr here it fail > > android-styled-dialogs\library\src\main\java\com\avast\android\dialogs\core\BaseDialogBuilder.java:5: > error: package android.support.v4.app does not exist > import android.support.v4.app.DialogFragment; > ^ > android-styled-dialogs\library\src\main\java\com\avast\android\dialogs\core\BaseDialogBuilder.java:6: > error: package android.support.v4.app does not exist > import android.support.v4.app.Fragment; > ^ > android-styled-dialogs\library\src\main\java\com\avast\android\dialogs\core\BaseDialogBuilder.java:7: > error: package android.support.v4.app does not exist > import android.support.v4.app.FragmentManager; > > I don't understand why it sometimes works and sometimes not. > I'm asking because of this > > http://forums.gradle.org/gradle/topics/missing-in-deployed-pom-files-if-different-than-jar-artifact-is-used > I want to force propagate <type>aad</type> to the generated pom.xml > > > > -- > 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/d/optout. > -- 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/d/optout.