排除com.google.gms的子模块

问题描述 投票:1回答:1

这是我的com.google.android.gms模块

+--- com.google.android.gms:play-services-location:11.0.1
|    +--- com.google.android.gms:play-services-base:[11.0.1] -> 11.0.1
|    |    \--- com.google.android.gms:play-services-tasks:[11.0.1] -> 11.0.1
|    |         \--- com.google.android.gms:play-services-basement:[11.0.1] -> 11.0.1
|    |              \--- com.android.support:support-v4:25.2.0
|    |                   +--- com.android.support:support-compat:25.2.0
|    |                   |    \--- com.android.support:support-annotations:25.2.0
|    |                   +--- com.android.support:support-media-compat:25.2.0
|    |                   |    +--- com.android.support:support-annotations:25.2.0
|    |                   |    \--- com.android.support:support-compat:25.2.0 (*)
|    |                   +--- com.android.support:support-core-utils:25.2.0
|    |                   |    +--- com.android.support:support-annotations:25.2.0
|    |                   |    \--- com.android.support:support-compat:25.2.0 (*)
|    |                   +--- com.android.support:support-core-ui:25.2.0
|    |                   |    +--- com.android.support:support-annotations:25.2.0
|    |                   |    \--- com.android.support:support-compat:25.2.0 (*)
|    |                   \--- com.android.support:support-fragment:25.2.0
|    |                        +--- com.android.support:support-compat:25.2.0 (*)
|    |                        +--- com.android.support:support-media-compat:25.2.0 (*)
|    |                        +--- com.android.support:support-core-ui:25.2.0 (*)
|    |                        \--- com.android.support:support-core-utils:25.2.0 (*)
|    \--- com.google.android.gms:play-services-tasks:[11.0.1] -> 11.0.1 (*)

目前,我想排除com.android.support:support-v4:25.2.0(因为它有一些与Fragment的错误)所以我喜欢

compile ('com.google.android.gms:play-services-location:11.0.1'){
    exclude group: 'com.android.support', module: 'support-v4'
}

但是,它不起作用。我在apply plugin: 'com.google.gms.google-services'找到了一个线索。当我删除apply plugin: 'com.google.gms.google-services'时,排除工作。

如何排除com.google.gms的子模块?任何帮助或建议将非常感谢。

android gradle google-play-services
1个回答
2
投票

它认为问题在于您只将它排除在该单个依赖项的传递依赖项中。

尝试在所有配置上完全排除它

configurations.all.exclude group: 'com.android.support', module: 'support-v4'
© www.soinside.com 2019 - 2024. All rights reserved.