举例
implementation ('com.squareup.picasso:picasso:2.71828'){
exclude module: 'support-v4'
exclude group: 'com.android.support'
}
说明:引用 Picasso库,需要排除 support-v4,其他库已经引用了support-v4。
解释
com.squareup.picasso:picasso:2.71828
com.squareup.picasso 就是 group
picasso 就是module
2.71828 是版本号
如何查看 android使用的库信息:
Maven Repository: Search/Browse/Explore (mvnrepository.com)
贴一张 support-v4的截图
gradle 普通写法
implementation group: 'com.android.support', name: 'support-v4', version: '28.0.0'
gradle 简写
implementation 'com.android.support:support-v4:28.0.0'
Maven 信息
<!-- https://mvnrepository.com/artifact/com.android.support/support-v4 -->
<dependency>
<groupId>com.android.support</groupId>
<artifactId>support-v4</artifactId>
<version>28.0.0</version>
</dependency>
参考: Gradle exclude排除指定依赖的办法_exclude group-CSDN博客