我已将我的compileSdkVersion更新为26.这是我的gradle文件现在的样子。如何使用最新的支持库(使用支持库26.0.2和compileSDKVersion 26无法解决错误)?
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId ##############
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
testCompile 'junit:junit:4.12'
}
可以预见的是,我得到的不匹配(?)的支持库(25.3.1)和CompileSdkVersion(26)的版本警告。
我试图更新支持库版本,以下版本:
- 编译 'com.android.support:appcompat-v7:26.0.0'
- 编译“com.android.support :程序兼容性-V7:26.0.2'
的问题
他们没有工作。这两种情况都显示Failed to resolve
错误。点击Install Repository and sync project
冻结Android Studio几秒钟,没有其他事情发生。
我错过了什么吗?
最新的Android支持版本库here是26.0.2
。
可能重复的[无法解决:com.android.support:appcompat-v7:26.0.0](https://stackoverflow.com/questions/45357000/failed-to-resolve-com-android-supportappcompat- v726-0-0) –