问题描述
我刚刚安装了新的 SDK 工具(Android L 开发者预览版),我正在尝试使用 RecyclerView
但它似乎丢失了.
I just installed the new SDK tools (Android L Developer Preview), and I'm trying to use RecyclerView
but it seems to be missing.
根据我的理解,我应该包含 v7
支持库,但我似乎不能这样做...
From my understanding I should include the v7
support library, but I can't seem to do that...
我似乎在 SDK 文件夹中找不到 v7 库(我确实从 SDK 管理器安装了 Android 支持库).
I can't seem to find the v7 library in the SDK folder (I did install the Android Support Library from the SDK Manager).
推荐答案
你必须更新 android 存储库、支持库并且你必须使用这个依赖:
You have to update the android repository, the support library and you have to use this dependency:
compile 'com.android.support:recyclerview-v7:+'
2017 年 10 月 30 日更新:
使用 +
不是一个好的选择,因为您将来无法复制构建.
Using the +
is not a good option because you are not able to replicate the build in the future.
您可以使用这些版本之一.检查您的 sdk 以获取更新版本:
You can use one of these versions. Check your sdk for updated version:
//it requires compileSdkVersion 27
implementation 'com.android.support:recyclerview-v7:27.1.0'
implementation 'com.android.support:recyclerview-v7:27.0.2'
implementation 'com.android.support:recyclerview-v7:27.0.1'
compile 'com.android.support:recyclerview-v7:27.0.0'
//it requires compileSdkVersion 26
//it requires to add the google maven repo
// maven {
// url "https://maven.google.com"
// }
compile 'com.android.support:recyclerview-v7:26.1.0'
compile 'com.android.support:recyclerview-v7:26.0.2'
compile 'com.android.support:recyclerview-v7:26.0.1'
compile 'com.android.support:recyclerview-v7:26.0.0'
//it requires compileSdkVersion 25
compile 'com.android.support:recyclerview-v7:25.4.0'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.0'
compile 'com.android.support:recyclerview-v7:25.2.0'
compile 'com.android.support:recyclerview-v7:25.1.1'
compile 'com.android.support:recyclerview-v7:25.1.0'
compile 'com.android.support:recyclerview-v7:25.0.0'
//it requires compileSdkVersion 24
compile 'com.android.support:recyclerview-v7:24.1.1'
compile 'com.android.support:recyclerview-v7:24.1.0'
//it requires compileSdkVersion 23
compile 'com.android.support:recyclerview-v7:23.4.0'
compile 'com.android.support:recyclerview-v7:23.3.0'
compile 'com.android.support:recyclerview-v7:23.2.1'
compile 'com.android.support:recyclerview-v7:23.2.0'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.android.support:recyclerview-v7:23.1.0'
compile 'com.android.support:recyclerview-v7:23.0.1'
compile 'com.android.support:recyclerview-v7:23.0.0'
//it requires compileSdkVersion 22
compile 'com.android.support:recyclerview-v7:22.2.1'
compile 'com.android.support:recyclerview-v7:22.2.0'
compile 'com.android.support:recyclerview-v7:22.1.1'
compile 'com.android.support:recyclerview-v7:22.1.0'
compile 'com.android.support:recyclerview-v7:22.0.0'
//it requires compileSdkVersion 21
compile 'com.android.support:recyclerview-v7:21.0.3'
compile 'com.android.support:recyclerview-v7:21.0.2'
compile 'com.android.support:recyclerview-v7:21.0.0'
这篇关于缺少 RecyclerView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!