进口android.support.v7.app不能得到解决support、android、app

2023-09-04 04:49:24 作者:狂暴者

更新到Eclipse开普勒后,我一直无法添加支持库appcompat。我跟着这个说明,我仍然得到错误的进口android.support.v7.app不能在以下行解决

after updating to Eclipse Kepler, I haven't been able to add the support library appcompat. I've followed this instructions and I still get the error The import android.support.v7.app cannot be resolved on the following lines:

import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;

我已经加入了appcompat项目,增加两个罐子到构建路径,选择它们的顺序和导出选项卡上,并在主项目添加库项目。

I have added the appcompat project, added both jars to the Build Path, selected them on the Order and Export tab, and added the library project in the main project.

我复制了V4磁带库可在主项目的libs文件夹,但我不知道自己还能做些什么或检查。有没有人有什么建议?

I copied the v4 library to the libs folder in the main project, but I don't know what else to do or check. Does anyone have any suggestions??

感谢您!

推荐答案

在appcompat_v7添加到您的依存关系,可以肯定的是,从项目文件夹为空。默认情况下,当你定义你的项目Android的支持 - v4.jar被创建,因此这将导致冲突,当你声明appcompat_v7库的依赖关系。

After you add appcompat_v7 to your dependencies, be sure that the libs folder from your project are empty. By default, an android-support-v4.jar is created when you define your project, so this will cause conflict when you declare appcompat_v7 library as your dependency.

所以,你需要做的第一件事是检查该文件夹 ... / MY_PROJECT /库和无畏地删除文件 Android的支持-v4.jar

So, the first thing you need to do is check the folder .../My_Project/libs and fearlessly delete the file android-support-v4.jar.

然后,添加appcompat_v7库项目的依赖关系: 要做到这一点,如果你使用的是Eclipse:

Then, add the appcompat_v7 library as a dependency of your project: To do this, if you are using Eclipse:

右键单击项目文件夹,位于导航器。 单击的性能,在最终的名单。 在属性窗口中,选择Android选项(左侧菜单)。 在盒库,添加新的参考。

如果您使用的是Android的工作室,你可以按照@Joey加西亚的评论中提到的步骤。

If you are using Android Studio, you can follow the steps mentioned in the @Joey Garcia's comment.

支持库设置 - https://developer.android.com/tools/support-library/setup.html

让我知道,如果它帮助你。祝你好运!

Let me know if it helped you. Good Luck!