Android 如何使用最新的支持库(无法解决支持库26.0.2和CompileSDK版本26的错误)?
我已将CompileSDK版本更新为26。这就是我的gradle文件现在的样子Android 如何使用最新的支持库(无法解决支持库26.0.2和CompileSDK版本26的错误)?,android,android-gradle-plugin,Android,Android Gradle Plugin,我已将CompileSDK版本更新为26。这就是我的gradle文件现在的样子 apply plugin: 'com.android.application' android { compileSdkVersion 26 buildToolsVersion "26.0.0" defaultConfig { applicationId ############## minSdkVersion 21 targetSdkVers
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'
}
可以预见,在support library(25.3.1)和CompileSDK(26)的版本中,我会收到不匹配(?)的警告
我已尝试将支持库版本更新为以下版本:
- 编译'com.android.support:appcompat-v7:26.0.0'
- 编译'com.android.support:appcompat-v7:26.0.2'
未能解决错误。单击安装存储库和同步项目将Android Studio冻结几秒钟,没有其他事情发生
我错过什么了吗
最新的Android支持版本库是26.0.2
,您应该将其添加到应用程序级别
build.gradle部分
最后
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
然后清除重建
并运行
FYI
如果您使用的是高于4.1的渐变版本,则必须使用:
allprojects {
repositories {
google()
}
}
转到文件->设置->Android SDK->SDK工具。
然后在Support Repository下拉列表中,选中android Support Repository复选框并进行更新。支持库不再通过可下载的maven Repository提供。版本26仅在google repo中可用。我没有使用maven@EugenPechanec.Me,maven repository!=专家