gpt4 book ai didi

Android:强制gradle只包含一个版本的库

转载 作者:IT王子 更新时间:2023-10-28 23:34:40 27 4
gpt4 key购买 nike

我在 build.gradle 中使用 'com.android.support:support-v4:23.3.0' 但在探索外部库时,我看到了两个版本的支持-v4 库(23.3.0 和 24.0.0)。如何找到使用 support-v4:24.0.0 库的依赖项?如何强制 gradle 仅添加 23.3.0 版本?

external libraries image

这是我在 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'
}
}

我使用 exclude group: 'com.android.support', module:'support-v4' 来避免其他人添加支持库但没有发生任何变化。

最佳答案

我无法添加评论,所以我在这里链接:

https://stackoverflow.com/a/37357786/3442734

使用:

configurations.all { 
resolutionStrategy.force 'com.android.support:support-v4:24.0.0'
}

关于Android:强制gradle只包含一个版本的库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44404308/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com