Why should I include the gradle dependency like `@ aar`

Why (or shouldnt) I include the gradle dependency like @aar,

What are the advantages / disadvantages, if any?

As you can see, I added @aar to the libraries below that supported it. But everything seemed to work before doing it ...

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.1.1'
    compile 'com.google.android.gms:play-services-maps:7.3.+'
    compile 'com.google.guava:guava:18.0'
    compile 'com.octo.android.robospice:robospice-spring-android:1.4.14'
    compile 'org.codehaus.jackson:jackson-mapper-asl:1.9.13'
    compile 'com.mcxiaoke.volley:library-aar:1.0.0@aar'
    compile 'de.psdev.licensesdialog:licensesdialog:1.7.0@aar'
}
+4
source share
2 answers

Libraries can be loaded in several formats, most of the time you will use .jaror .aar.

If you do not specify a suffix @, you will load the library in the default format (determined by its author, if not then .jar), as well as all its dependencies.

compile 'com.android.support:appcompat-v7:22.1.1'

@, ( ). , , , .aar, maven ( gradle, ) .jar . @, , .

compile 'com.android.support:appcompat-v7:22.1.1@aar'
compile 'com.android.support:support-v4:22.1.1@jar'

, , @ , :

compile ('com.android.support:appcompat-v7:22.1.1@aar') {
    transitive = true
}
+16

TL; DR: @, , .

, , ...

@ , , , ID/, .

, Android, , AAR, , . , , JAR , , , AAR . AAR, JAR ID/ , , . , @, , , .

Android Studio , AAR, JAR, . , Maven Android , JAR, AAR.

, , , @ , . , , .

@ , -, . , compile 'com.android.support:appcompat-v7:22.1.1@jar' , AAR - , .

+4

All Articles