在我的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
库
File => Project Structure => Dependencies
以下是截图
我的问题
为什么我无法看到v7版本的支持库:23.0.4?
如果没有安装支持库,它怎么会在我的SDK Manager中显示?
编辑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'
}
答案 0 :(得分:1)
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文件夹并重新创建它。