What's @aar value with transitive = true

I am using crashlytics as an example only.

what is the difference from

    compile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') { transitive = true; }

      

and

    compile 'com.crashlytics.sdk.android:crashlytics:2.6.8'

      

+3


source to share


1 answer


If you use the notation ...@artifacttype

depending on Gradle it means "just get me this artifact and no transitive dependencies". In addition, when installing transitive = true

, you are choosing transitive dependencies, despite this fact.

The first version gets aar

with dependencies, and as far as I remember, the second always gets jar

if it's present, and nothing but dependencies. Add configurations.compile.each { println it }

to output the actual files in the config and you should see the difference.



In case crashlytics

there is no difference:

compile 'com.crashlytics.sdk.android:crashlytics:2.6.8'
/home/xan/.gradle/caches/modules-2/files-2.1/com.crashlytics.sdk.android/crashlytics/2.6.8/2f667ae0609d82045cbe602d38df3fbf2c9528dd/crashlytics-2.6.8.aar
/home/xan/.gradle/caches/modules-2/files-2.1/com.crashlytics.sdk.android/beta/1.2.5/f73d30657bb44ecb79d434a4ae3fb7d887371d84/beta-1.2.5.aar
/home/xan/.gradle/caches/modules-2/files-2.1/io.fabric.sdk.android/fabric/1.3.17/85fc9aae9009f6fb2beaf23fa0ce1ae13f124413/fabric-1.3.17.aar
/home/xan/.gradle/caches/modules-2/files-2.1/com.crashlytics.sdk.android/crashlytics-core/2.3.17/f3bed4c297be8d30dc5aa7f18b06dff75435bde4/crashlytics-core-2.3.17.aar
/home/xan/.gradle/caches/modules-2/files-2.1/com.crashlytics.sdk.android/answers/1.3.13/83dc1dd439c7da04ce9705f18037fe7551ae06bc/answers-1.3.13.aar

compile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') { transitive = true; }
/home/xan/.gradle/caches/modules-2/files-2.1/com.crashlytics.sdk.android/crashlytics/2.6.8/2f667ae0609d82045cbe602d38df3fbf2c9528dd/crashlytics-2.6.8.aar
/home/xan/.gradle/caches/modules-2/files-2.1/com.crashlytics.sdk.android/beta/1.2.5/f73d30657bb44ecb79d434a4ae3fb7d887371d84/beta-1.2.5.aar
/home/xan/.gradle/caches/modules-2/files-2.1/io.fabric.sdk.android/fabric/1.3.17/85fc9aae9009f6fb2beaf23fa0ce1ae13f124413/fabric-1.3.17.aar
/home/xan/.gradle/caches/modules-2/files-2.1/com.crashlytics.sdk.android/crashlytics-core/2.3.17/f3bed4c297be8d30dc5aa7f18b06dff75435bde4/crashlytics-core-2.3.17.aar
/home/xan/.gradle/caches/modules-2/files-2.1/com.crashlytics.sdk.android/answers/1.3.13/83dc1dd439c7da04ce9705f18037fe7551ae06bc/answers-1.3.13.aar

      

+4


source







All Articles