Android:强制gradle只包含一个库的一个版本 [英] Android: force gradle to include only one version of a library
问题描述
我在 build.gradle
'com.android.support:support-v4:23.3.0' >但是当探索外部库时,我看到两个版本的support-v4库(23.3.0& 24.0.0)。我怎样才能找到哪个依赖使用支持-v4:24.0.0库?我如何强制gradle只添加版本23.3.0?
这是我在build.gradle中的依赖列表:
依赖项{
编译fileTree(dir:'libs',include:['* .jar'])
compile'com.android.support:appcompat-v7:23.3.0'
compile'com.android.support:support-v4:23.3.0'
compile'com.android.support :design:23.3.0'
compile'com.android.support:recyclerview-v7:23.3.0'
compile'com.android.support:cardview-v7:23.3.0'
'compile'('com.nightonke:wowoviewpager:1.0.2'){
exclude group:'com.android.support',module:'support-v4'
}
compile(' com.j256.ormlite:ormlite-android:5.0'){
exclude group:'com.android.support',module:'support-v4'
}
编译文件('libs /picasso-2.5.2.jar )
编译文件('libs / easyandroidanimationslibrary-v0.5.jar')
编译文件('libs / apache-httpcomponents-httpclient.jar')
编译文件('libs / apache -httpcomponents-httpcore.jar')
compile'co.ronash.android:pushe-base:1.2.0'
compile'com.google.android.gms:play-services-gcm:9.4。 0'
compile('com.github.ozodrukh:CircularReveal:2.0.1@aar'){
transitive = true;
}
编译文件('libs / btsdk.jar')
编译项目(':zxing_barcode')//此项目包含相同版本的support-v4库
编译项目(':cropper')//此项目包含相同版本的support-v4库
编译项目(':taptargetview')//此项目包含相同版本的support-v4库
编译('me.cheshmak:analytics:1.0.28'){
exclude group:'com.android.support',module:'support-v4'
}
compile'com.github .siyamed:android-shape-imageview:0.9.3@aar'
compile('com.github.rey5137:material:1.2.2'){
exclude group:'com.android.support' ,模块:'support-v4'
}
compile('jp.wasabeef:recyclerview-animators:2.2.3'){
排除组:'com.android.support',module :'support-v4'
}
compile('com.github.deano2390:MaterialShowcaseView:1.1.0@aar'){
exc lude group:'com.android.support',module:'support-v4'
}
compile'org.greenrobot:eventbus:3.0.0'
compile'com.google.code .gson:gson:2.4'
compile('com.crashlytics.sdk.android:crashlytics:2.6.6@aar'){
transitive = true;
}
compile('com.crashlytics.sdk.android:answers:1.3.11@aar'){
transitive = true;
}
编译('cat.ereza:customactivityoncrash:1.5.0'){
排除组:'com.android.support',模块:'support-v4'
$ b我使用 exclude组: 'com.android.support',模块:'support-v4'
,以避免其他人添加支持库,但没有发生变化。 方案
我无法添加评论,所以我在这里链接:
https://stackoverflow.com/a/37357786/3442734
使用:
configurations.all {
resolutionStrategy.force'com.android.support:support-v4:24.0.0'
}
I use 'com.android.support:support-v4:23.3.0'
in my build.gradle
but when explore external libraries I see two version of support-v4 library (23.3.0 & 24.0.0). How can I find which dependency use support-v4:24.0.0 library? How can I force gradle to only add version 23.3.0?
this is my dependency list in build.gradle:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:support-v4:23.3.0'
compile 'com.android.support:design:23.3.0'
compile 'com.android.support:recyclerview-v7:23.3.0'
compile 'com.android.support:cardview-v7:23.3.0'
compile ('com.nightonke:wowoviewpager:1.0.2') {
exclude group: 'com.android.support', module:'support-v4'
}
compile ('com.j256.ormlite:ormlite-android:5.0'){
exclude group: 'com.android.support', module:'support-v4'
}
compile files('libs/picasso-2.5.2.jar')
compile files('libs/easyandroidanimationslibrary-v0.5.jar')
compile files('libs/apache-httpcomponents-httpclient.jar')
compile files('libs/apache-httpcomponents-httpcore.jar')
compile 'co.ronash.android:pushe-base:1.2.0'
compile 'com.google.android.gms:play-services-gcm:9.4.0'
compile('com.github.ozodrukh:CircularReveal:2.0.1@aar') {
transitive = true;
}
compile files('libs/btsdk.jar')
compile project(':zxing_barcode') // this project include the same version of support-v4 library
compile project(':cropper')// this project include the same version of support-v4 library
compile project(':taptargetview')// this project include the same version of support-v4 library
compile ('me.cheshmak:analytics:1.0.28'){
exclude group: 'com.android.support', module:'support-v4'
}
compile 'com.github.siyamed:android-shape-imageview:0.9.3@aar'
compile ('com.github.rey5137:material:1.2.2'){
exclude group: 'com.android.support', module:'support-v4'
}
compile ('jp.wasabeef:recyclerview-animators:2.2.3'){
exclude group: 'com.android.support', module:'support-v4'
}
compile ('com.github.deano2390:MaterialShowcaseView:1.1.0@aar'){
exclude group: 'com.android.support', module:'support-v4'
}
compile 'org.greenrobot:eventbus:3.0.0'
compile 'com.google.code.gson:gson:2.4'
compile('com.crashlytics.sdk.android:crashlytics:2.6.6@aar') {
transitive = true;
}
compile('com.crashlytics.sdk.android:answers:1.3.11@aar') {
transitive = true;
}
compile ('cat.ereza:customactivityoncrash:1.5.0'){
exclude group: 'com.android.support', module:'support-v4'
}
}
I use exclude group: 'com.android.support', module:'support-v4'
to avoid others adding support library but no change happened.
I can't add comment so I link here:
https://stackoverflow.com/a/37357786/3442734
use:
configurations.all {
resolutionStrategy.force 'com.android.support:support-v4:24.0.0'
}
这篇关于Android:强制gradle只包含一个库的一个版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!