gpt4 book ai didi

android - Gradle compile dependencies with/out "@aar"有什么区别?

转载 作者:行者123 更新时间:2023-11-30 00:22:16 24 4
gpt4 key购买 nike

我的 Android 项目中有 gradle 依赖配置:

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.appsflyer:af-android-sdk:4.8.0@aar'
provided 'com.segment.analytics.android:analytics:4.+'
}

但是我可以编写 compile 'com.appsflyer:af-android-sdk:4.8.0@aar' 行而无需 @aar

compile 'com.appsflyer:af-android-sdk:4.8.0

他们告诉 Appsflyer 文档使用 @aar 但由于我是 gradle 的新手,使用/不使用 @aar 后缀有什么区别吗?因为它看起来在这两种情况下都有效

最佳答案

使用 @aar 表示法意味着您只想下载 aar Artifact ,并且没有依赖项
documentation这部分可以查看:
检查 Artifact only notation 部分:

An artifact only notation creates a module dependency which downloads only the artifact file with the specified extension. Existing module descriptors are ignored..

使用@aar 表示法,如果你想下载依赖,你应该添加transitive=true

关于android - Gradle compile dependencies with/out "@aar"有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46051896/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com