从Android Studio中的项目中导入的模块中排除重复的aar库

时间:2019-01-09 16:51:27

标签: android android-studio gradle

我正在构建一个应用程序,其中正在导入一个包含RxPermissions作为@aar依赖项的模块。

此外,主应用程序还包括@aar作为依赖项。

因此,我在运行项目时遇到合并冲突。

该场景变为: -主应用程序包含RxPermissions -主要应用包括外部模块 -外部模块包含RxPermissions

RxPermissions的版本不同。

主应用程序(第一行包含RxPermissions,最后一行包含模块):

implementation 'com.tbruyelle.rxpermissions2:rxpermissions:0.9.5@aar'

implementation 'com.airbnb.android:lottie:2.7.0'
implementation 'com.github.pwittchen:networkevents:2.1.6'
implementation 'com.github.chrisbanes:PhotoView:2.1.3'

// debug product flavour implemented
debugImplementation 'com.facebook.stetho:stetho:1.5.0'
debugImplementation 'com.facebook.stetho:stetho-okhttp3:1.5.0'
debugImplementation 'com.github.kittinunf.fuel:fuel-android:1.14.0'

implementation 'com.crashlytics.sdk.android:crashlytics:2.9.6'
implementation 'com.crashlytics.sdk.android:crashlytics-ndk:2.0.5'


implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$rootProject.ext.kotlin_version"
implementation 'joda-time:joda-time:2.10'
debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.6.1'
debugImplementation 'com.squareup.leakcanary:leakcanary-support-fragment:1.6.1'
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.1'
implementation 'com.google.firebase:firebase-perf:16.2.0'

implementation project(path: ':material-camera')
implementation("com.afollestad:easyvideoplayer:0.3.0") {
    exclude group: 'com.android.support'
    exclude group: 'me.zhanghai.android.materialprogressbar'
}

implementation 'io.realm:android-adapters:2.1.1'

implementation project(path: ':mapdrawinglibrary') {
    exclude group: 'com.tbruyelle.rxpermissions'
}

外部模块:

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    def SupportLibVersion = '25.3.1'
    implementation "com.android.support:appcompat-v7:$SupportLibVersion",
            "com.android.support:design:$SupportLibVersion"

    def playServicesVersion = '10.2.1'
    implementation "com.google.android.gms:play-services-maps:$playServicesVersion",
            "com.google.android.gms:play-services-location:$playServicesVersion"

    implementation('com.schibstedspain.android:android-reactive-location:0.10.1') {
        exclude group: 'com.google.android.gms'
    }
    implementation 'com.tbruyelle.rxpermissions:rxpermissions:0.9.4@aar'

    implementation 'com.google.maps.android:android-maps-utils:0.5+'
    testImplementation 'junit:junit:4.12'
}

0 个答案:

没有答案