首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >android支持v4 13.0.0和23.4.0的Gradle依赖问题

android支持v4 13.0.0和23.4.0的Gradle依赖问题
EN

Stack Overflow用户
提问于 2017-05-06 20:33:30
回答 1查看 243关注 0票数 0

你好,我似乎在我的gradle中找不到13.0.0版本。我也在gradle中使用以下代码将其设置为23.4.0,但它不会改变任何东西。

THanks:

代码语言:javascript
运行
复制
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'

}

错误日志:发现以下模块之间存在冲突:- com.android.support:support-v4:13.0.0 - com.android.support:support-v4:23.4.0

EN

Stack Overflow用户

发布于 2017-05-06 20:40:16

删除compile 'com.android.support:support-v4:13.0.0'内部依赖项。您有两个版本的support-v4工件。

代码语言:javascript
运行
复制
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

}
票数 0
EN
查看全部 1 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43820505

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档