导入android.support.v7.app无法解析 [英] The import android.support.v7.app cannot be resolved

查看:1426
本文介绍了导入android.support.v7.app无法解析的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在更新到Eclipse Kepler之后,我无法添加支持库appcompat。我遵循了这个



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


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;

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.

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??

Thank you!

解决方案

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.

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

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

  1. Right click in your project folder, located in the Navigator.
  2. Click in properties, in the final of the list.
  3. In the Properties window, select the Android option (left menu).
  4. In the box Library, add your new reference.

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

Support Library Setup - https://developer.android.com/tools/support-library/setup.html

Let me know if it helped you. Good Luck!

这篇关于导入android.support.v7.app无法解析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆