简体   繁体   中英

Gradle dependency issue with android support v4 13.0.0 & 23.4.0

Hello I can't seem to find the version 13.0.0 anywhere in my gradle..I've also set it to 23.4.0 in the gradle using the following code but it does not change anything.

THanks:

apply plugin: 'com.android.application'

android {
    buildTypes {
    compileSdkVersion 23
    buildToolsVersion '25.0.0'

    defaultConfig {
        applicationId "com.parse.starter"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }
        release {


            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        /*dexOptions {
            javaMaxHeapSize "4g";;-


        }*/
}
    buildToolsVersion '25.0.0'
}



ext {

    supportLibraryVersion = '23.4.0'
    playServicesVersion = '3.2.65'
    boltVersion = '1.4.0'
}

subprojects {
    project.configurations.all {
        resolutionStrategy.eachDependency { details ->
            if (details.requested.jar == 'com.android.support'
                    && !details.requested.name.contains('multidex')) {
                details.useVersion "$supportLibraryVersion"
            }
            if (details.requested.jar == 'com.google.android.gms'){
                details.useVersion "playServicesVersion"
            }
            if (details.requested.jar == 'com.android.support:animated-vector-drawable'){

                details.useVersion "$supportLibraryVersion"

            }
            if (details.requested.jar == 'com.parse.bolts:bolts-tasks'){

                details.useVersion "$boltVersion"

            }


        }


    }
}

configurations.all {
    resolutionStrategy {
        // fail eagerly on version conflict (includes transitive dependencies)
        // e.g. multiple different versions of the same dependency (group and name are equal)
        failOnVersionConflict()

        // prefer modules that are part of this build (multi-project or composite build) over external modules
        preferProjectModules()


        dependencySubstitution {

            substitute module('com.android.support:animated-vector-drawable:23.4.0') with module('com.android.support:animated-vector-drawable:23.0.0')
            //substitute module('com.google.android.gms:play-services:3.2.65') with module('com.google.android.gms:play-services:9.4.0')
            substitute module('com.android.support:appcompat-v7:13.0.0') with module('com.android.support:appcompat-v7:23.4.0')
        }
    }}

dependencies {
    compile "com.android.support:appcompat-v7:$supportLibraryVersion"
    compile "com.google.android.gms:play-services:$playServicesVersion"
    compile "com.google.android.gms:play-services-maps:$playServicesVersion"
    compile "com.parse.bolts:bolts-tasks:$boltVersion"
    compile 'com.parse:parse-android:1.13.0'
    compile 'com.android.support:multidex:1.0.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.google.maps.android:android-maps-utils:0.3'
    compile 'com.android.support:support-v4:13.0.0'

}

ERROR LOG:A conflict was found between the following modules: - com.android.support:support-v4:13.0.0 - com.android.support:support-v4:23.4.0

Remove compile 'com.android.support:support-v4:13.0.0' inside dependencies. You've two version of support-v4 artifact.

dependencies {
    compile "com.android.support:appcompat-v7:$supportLibraryVersion"
    compile "com.google.android.gms:play-services:$playServicesVersion"
    compile "com.google.android.gms:play-services-maps:$playServicesVersion"
    compile "com.parse.bolts:bolts-tasks:$boltVersion"
    compile 'com.parse:parse-android:1.13.0'
    compile 'com.android.support:multidex:1.0.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.google.maps.android:android-maps-utils:0.3'
    compile 'com.android.support:support-v4:13.0.0'  // <-- This is your version 13.1.0

}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM