首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >解决失败:com.android.Support:support:27.2.0

解决失败:com.android.Support:support:27.2.0
EN

Stack Overflow用户
提问于 2018-05-07 14:40:39
回答 2查看 2.7K关注 0票数 1

我的App中的依赖项有一个问题:

代码语言:javascript
复制
apply plugin: 'com.android.application'

android {
compileSdkVersion 27
defaultConfig {
    applicationId "fr.android.MyApp"
    minSdkVersion 16
    targetSdkVersion 27
    versionCode 1
    versionName "1.0"
    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')
implementation 'com.android.support:appcompat-v7:25.1.1'
implementation 'com.android.support:animated-vector-drawable:27.1.1'
implementation 'com.android.support:support-compat:27.2.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.google.firebase:firebase-auth:11.6.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-   core:3.0.2'
}
apply plugin: 'com.google.gms.google-services'

得到错误的行是:

代码语言:javascript
复制
implementation 'com.android.support:animated-vector-drawable:27.1.1'

上面写着:未能解决: com.android.support:animated-vector-drawable:27.1.1

以及:

我还得到:配置‘编译’已经过时,并已被替换为‘实现’和'api‘。它将在2018年年底被移除。

这是我的build.gradle:

代码语言:javascript
复制
// Top-level build file where you can add configuration options common to all   sub-projects/modules.

buildscript {

repositories {
    google()
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.1.2'


    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
    classpath 'com.google.gms:google-services:3.1.1'
      }
   }

allprojects {
repositories {
    google()
    jcenter()
   }
}

task clean(type: Delete) {
delete rootProject.buildDir
}

知道怎么解决这个问题吗?提前谢谢。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2018-05-07 15:00:31

这是因为您使用了appcompat库的旧版本,即:

代码语言:javascript
复制
implementation 'com.android.support:appcompat-v7:25.1.1'

将它的版本从v7:25.1.1改为27.1.1

示例:

代码语言:javascript
复制
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:animated-vector-drawable:27.1.1'
implementation 'com.android.support:support-compat:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.google.firebase:firebase-auth:11.6.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-   core:3.0.2'
}

更改后同步项目

票数 2
EN

Stack Overflow用户

发布于 2018-05-07 15:00:17

所有com.android.support必须使用完全相同的版本规范。

animated-vector-drawable:27.1.127.1.1版本中使用,support-compat27.2.0版本中使用。你应该做同样的版本。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50216846

复制
相关文章

相似问题

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