在我的 Android 工作室中,我只能看到版本 25.0.0 的支持库,但是当我尝试添加 com.android.support:recyclerview-v7:23.0.4 时,我的编译 SDK 版本是 23
我收到一条错误消息
Error:(27, 13) Failed to resolve: com.android.support:recyclerview-v7:23.0.4
但根据 SDK 管理器,它显示我已经安装了所有支持库。
除此之外,我无法在菜单中找到 v7:23.0.4
库
文件 => 项目结构 => 依赖项
这是截图
我的问题
为什么我看不到版本 v7:23.0.4 的支持库?
如果没有安装支持库,为什么它没有显示在我的 SDK 管理器中?
编辑 1
Build.gradle(Module.app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "appnotic.quicknotes"
minSdkVersion 18
targetSdkVersion 23
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(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:25.0.2'
}
最佳答案
1) 它在存储库中不可用,为什么?我不知道,但这不是版本 23 的最新版本,请尝试 com.android.support:recyclerview-v7:23.2.1
2) 您不使用 SDK 管理器安装库,它只安装 gradle 从中获取库的源代码,库本身在您构建时下载
我尝试使用 23.0.4 无法获取,使用 23.2.1 可以。如果您可以获得版本 25.0.0,则意味着存储库已安装,也许 gradle 项目不知何故搞砸了。尝试删除项目 iml 文件和 .idea 文件夹并重新创建。
关于android - 缺少支持库 v7 23,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42678282/