appcompat 25.1.1在android studio 2.3中显示错误

时间:2017-03-04 09:49:37

标签: android android-studio build.gradle android-studio-2.3

将android studio 2.2更新为2.3 appcompat 25.1.1显示错误 com.android.support库必须使用相同版本。在工作室2.2它工作正常,在2.3它只显示错误但应用程序运行正常,我已附加错误的一个屏幕截图。

appcompat is showing error in android studio 2.3

5 个答案:

答案 0 :(得分:2)

在依赖项

之前将以下代码添加到build.gradle(app)
configurations.all {
  resolutionStrategy.force 'com.android.support:support-annotations:25.2.0'
}

答案 1 :(得分:1)

转到项目Files/My project/.idea/libraries,查看您的图书馆有何不同之处。在gradle文件中包含具有相同版本的此不同库。同步你的项目。

答案 2 :(得分:0)

您有两个不同版本的支持库。对所有类型的支持工件使用相同的版本。

答案 3 :(得分:-1)

根据buildtool版本更改它。像这样

apply plugin: 'com.android.library'

android {
compileSdkVersion 25
buildToolsVersion "25.0.1"

defaultConfig {
    minSdkVersion 16
    targetSdkVersion 25
    versionCode 1
}

}

dependencies {
compile "com.android.support:appcompat-v7:25.0.1"
}

答案 4 :(得分:-1)

请添加以下行

compile 'com.android.support:customtabs:25.3.0'

快乐编码:)