错误"包android.support.v7.app不存在" [英] Error "package android.support.v7.app does not exist"

查看:10157
本文介绍了错误"包android.support.v7.app不存在"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新android开发,我一直在使用命令行工具来创建一个Android项目。我跟所有的Andr​​oid开发者在教程的指示。然而,他们对IDE用户更多关注。

I am new to android development, and I have been using the command line tools to create an android project. I followed all the instructions given in the tutorial at android developers. However, they are focused more on IDE users.

当我试图从ActionBarActivity,而不只是活动延长我的MainActivity类,它抛出下面的错误。

When I tried extending my MainActivity class from ActionBarActivity instead of just Activity, it threw the following error.

错误:包android.support.v7.app不存在

error: package android.support.v7.app does not exist

有人抱怨这个import语句。

It was complaining about this import statement.

import android.support.v7.app.ActionBarActivity;

我做了一定要参观SDK管理器,它说的是安装Android的支持库。 我真的难倒就这一个,我真的AP preciate任何帮助你们可以给我。

I made sure to visit the SDK manager, and it says Android Support Library is installed. I am truly stumped on this one, and I would really appreciate any help you guys could give me.

这可能会帮助: 的http://developer.android.com/reference/android/support/v7/app/ActionBarActivity.html

推荐答案

您的项目缺少从SDK的支持库。

Your project is missing the support library from the SDK.

如果你没有安装的话,只需右键单击项目>安卓工具>安装支持库。

If you have no installed them, just right click on the project > Android Tools > Install support library.

然后,只需导入到工作区中,作为一个Android项目,Android的支持-V7-appcompat,坐落在$ {Android的SDK路径} /演员/安卓/支持/ V7

Then, just import into workspace, as an Android project, android-support-v7-appcompat, located into ${android-sdk-path}/extras/android/support/v7

最后,单击鼠标右键,在Android项目>属性> Android的标签。按Add按钮,添加支持项目Android的支持-V7-appcompat的依赖。

And finally, right click in the Android project > Properties > Android Tab. Push the Add button and add the support project "android-support-v7-appcompat" as dependency.

清理项目和必须编译和正常工作。

Clean your project and the must compile and work properly.

这篇关于错误"包android.support.v7.app不存在"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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