Libraries can be uploaded in multiple formats, most of the time you'll be using .jar
or .aar
.
When you don't specify the @
suffix, you'll be downloading the library in it's default format (defined by its author, if not then .jar
) along with all its dependencies.
compile 'com.android.support:appcompat-v7:22.1.1'
When you specify the @
suffix you enforce downloading the library in the format you specify (which may or may not exist). This is useful e.g. when author forgot to specify that the library is an .aar
and maven (or gradle, not sure) treats it as .jar
by default. When the @
suffix is specified the dependencies of this library are no longer downloaded so you have to ensure that manually.
compile 'com.android.support:appcompat-v7:22.1.1@aar'
compile 'com.android.support:support-v4:22.1.1@jar'
To ensure the full dependency tree of the library is downloaded while the @
suffix is specified you have to write it in the following way:
compile ('com.android.support:appcompat-v7:22.1.1@aar') {
transitive = true
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…