Android库项目类未找到错误

时间:2014-05-18 06:05:25

标签: android

我有一个Android项目,想要添加第三方库项目。库项目在属性中选中了“Is Library”。我通过转到属性在我的主项目中添加了库 - >然后Android添加了库。我看了很多stackoverflow帖子,这些帖子表明这是添加库项目的正确方法。我仍然得到一个类定义未找到错误,我不知道为什么。

1 个答案:

答案 0 :(得分:0)

您是否按照谷歌文档中给出的确切步骤进行操作? 点击此处https://developer.android.com/tools/support-library/setup.html

我引用了这里所需的步骤 基于支持库代码创建库项目:

  Make sure you have downloaded the Android Support Library using the SDK Manager.
    Create a library project and ensure the required JAR files are included in the project's build path:
        Select File > Import.
        Select Existing Android Code Into Workspace and click Next.
        Browse to the SDK installation directory and then to the Support Library folder. For example, if you are adding the appcompat project, browse to <sdk>/extras/android/support/v7/appcompat/.
        Click Finish to import the project. For the v7 appcompat project, you should now see a new project titled android-support-v7-appcompat.
        In the new library project, expand the libs/ folder, right-click each .jar file and select Build Path > Add to Build Path. For example, when creating the the v7 appcompat project, add both the android-support-v4.jar and android-support-v7-appcompat.jar files to the build path.
        Right-click the project and select Build Path > Configure Build Path.
        In the Order and Export tab, check the .jar files you just added to the build path, so they are available to projects that depend on this library project. For example, the appcompat project requires you to export both the android-support-v4.jar and android-support-v7-appcompat.jar files.
        Uncheck Android Dependencies.
        Click OK to complete the changes.