我已经更新了我的Android SDK,使用的是Android 5.0(API 21); 我还更新了平台工具和构建工具。
在将RecycleView添加到布局XML文件后,我遇到了The following classes could not be found: - android.support.v7.widget.RecyclerView (Fix Build Path, Edit XML, Create Class)
错误。
我的布局XML文件如下所示:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.androidlintro.MainActivity" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" />
<android.support.v7.widget.RecyclerView
android:id="@+id/my_recycler_view"
android:scrollbars="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</RelativeLayout>
有人能告诉我出了什么问题吗?即使我已经下载了完整的软件包(新的SDK、构建工具、平台工具等),我还是会遇到这个错误。
注意:我正在使用Eclipse IDE。