Android依赖版本不同

时间:2018-11-14 19:36:53

标签: java android android-gradle build.gradle

我是android学习的初学者,在build.gradle(app)中有问题

  

将此项目转换为库时,遇到错误:执行   任务“ Android依赖项”失败   'com.android.support:support-core-ui'具有不同的版本   编译(27.1.1)和运行时(28.0.0)类路径。您应该手动   通过DependencyResolution设置相同的版本

apply plugin: 'com.android.application'
apply plugin: 'com.google.cloud.tools.endpoints-framework-client'

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.google.cloud.tools:endpoints-framework-gradle-plugin:1.0.2'

    }
}

android {
    compileSdkVersion 27
    buildToolsVersion '27.0.3'

    defaultConfig {
        applicationId "com.udacity.gradle.builditbigger"
        minSdkVersion 16
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        multiDexEnabled true

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    endpointsServer project(path: ':backend', configuration: 'endpoints')
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:support-v4:27.1.1'
    implementation 'com.google.android.gms:play-services-ads:11.8.0'
    implementation 'com.google.api-client:google-api-client:1.23.0'
    implementation 'com.google.http-client:google-http-client-android:1.23.0'
    implementation 'com.google.code.findbugs:jsr305:3.0.1'
    implementation project(path: ':JavaJokes')
    implementation project(path: ':jokeslibrary')
    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    testImplementation 'junit:junit:4.12'
}

并返回以下错误

 Android dependency 'com.android.support:support-core-ui' has different 
version for the compile (27.1.1) and runtime (28.0.0) classpath. You should 
manually set the same version via DependencyResolution

0 个答案:

没有答案