android依赖本地工程排除,Gradle 排除排除本地项目 部分依赖

1. 查看依赖树

./gradlew app:dependencies --configuration releaseRuntimeClasspath

+--- com.android.support.constraint:constraint-layout:1.1.2

| \--- com.android.support.constraint:constraint-layout-solver:1.1.2

+--- com.android.support:appcompat-v7:26.1.0

| +--- com.android.support:support-annotations:26.1.0 -> 27.1.1

| +--- com.android.support:support-v4:26.1.0

| | +--- com.android.support:support-compat:26.1.0 -> 27.1.1

| | | +--- com.android.support:support-annotations:27.1.1

| | | \--- android.arch.lifecycle:runtime:1.1.0

| | | +--- android.arch.lifecycle:common:1.1.0

| | | \--- android.arch.core:common:1.1.0

| | +--- com.android.support:support-media-compat:26.1.0

| | | +--- com.android.support:support-annotations:26.1.0 -> 27.1.1

| | | \--- com.android.support:support-compat:26.1.0 -> 27.1.1 (*)

| | +--- com.android.support:support-core-utils:26.1.0 -> 27.1.1

| | | +--- com.android.support:support-annotations:27.1.1

| | | \--- com.android.support:support-compat:27.1.1 (*)

| | +--- com.android.support:support-core-ui:26.1.0 -> 27.1.1

| | | +--- com.android.support:support-annotations:27.1.1

| | | +--- com.android.support:support-compat:27.1.1 (*)

| | | \--- com.android.support:support-core-utils:27.1.1 (*)

| | \--- com.android.support:support-fragment:26.1.0 -> 27.1.1

| | +--- com.android.support:support-compat:27.1.1 (*)

| | +--- com.android.support:support-core-ui:27.1.1 (*)

| | +--- com.android.support:support-core-utils:27.1.1 (*)

| | +--- com.android.support:support-annotations:27.1.1

| | +--- android.arch.lifecycle:livedata-core:1.1.0

| | | +--- android.arch.lifecycle:common:1.1.0

| | | +--- android.arch.core:common:1.1.0

| | | \--- android.arch.core:runtime:1.1.0

| | | \--- android.arch.core:common:1.1.0

| | \--- android.arch.lifecycle:viewmodel:1.1.0

| +--- com.android.support:support-vector-drawable:26.1.0

| | +--- com.android.support:support-annotations:26.1.0 -> 27.1.1

| | \--- com.android.support:support-compat:26.1.0 -> 27.1.1 (*)

| \--- com.android.support:animated-vector-drawable:26.1.0

| +--- com.android.support:support-vector-drawable:26.1.0 (*)

| \--- com.android.support:support-core-ui:26.1.0 -> 27.1.1 (*)

+--- com.android.support:recyclerview-v7:26.1.0

| +--- com.android.support:support-annotations:26.1.0 -> 27.1.1

| +--- com.android.support:support-compat:26.1.0 -> 27.1.1 (*)

| \--- com.android.support:support-core-ui:26.1.0 -> 27.1.1 (*)

\--- com.github.bumptech.glide:glide:4.7.1

+--- com.github.bumptech.glide:gifdecoder:4.7.1

| \--- com.android.support:support-annotations:27.1.1

+--- com.github.bumptech.glide:disklrucache:4.7.1

+--- com.github.bumptech.glide:annotations:4.7.1

\--- com.android.support:support-fragment:27.1.1 (*)

符号的含义:

x.x.x () 该依赖已经有了,将不再重复依赖。

x.x.x -> x.x.x 该依赖的版本被箭头所指的版本代替。

x.x.x -> x.x.x() 该依赖的版本被箭头所指的版本代替,并且该依赖已经有了,不再重复依赖。

2. Exclude 排除

排除所有:

// 在build.gradle 中添加下面节点

configurations {

all*.exclude module: "support-fragment"

}

排除指定:

非本地项目

implementation ('com.github.bumptech.glide:glide:4.7.1'){

exclude module:"support-fragment"

}

本地项目

compile(project(':xxx')) {

exclude group: 'com.facebook.react', module: 'react-native'

}

3. Force 强制指定

强制所有:

configurations.all {

resolutionStrategy {

force 'com.android.support:support-fragment:26.1.0'

}

}

强制指定:

// 在build.gradle 中添加下面节点

implementation ( 'com.meituan.android.pay.quickpass.baseinterface:library:1.0.0') {

force = true

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值