这是我的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的子模块?任何帮助或建议将非常感谢。
它认为问题在于您只将它排除在该单个依赖项的传递依赖项中。
尝试在所有配置上完全排除它
configurations.all.exclude group: 'com.android.support', module: 'support-v4'