不能使用Android的工作室从Android的支持库导入ActionBarCompat [英] Can't import ActionBarCompat from Android Support Library using Android Studio

查看:161
本文介绍了不能使用Android的工作室从Android的支持库导入ActionBarCompat的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的Andr​​oid Studio和遵循这篇文章从谷歌以及一些其他物品的讨论如何使用新的ActionBarCompat。

I am using Android Studio and have followed this article from google as well as some other articles discussing how to use the new ActionBarCompat.

我在Android SDK中管理器下载支持库(启18),并增加在下面​​我的的build.gradle

I have downloaded the support library (Rev. 18) in Android SDK Manager and added the following in my build.gradle

dependencies {
compile 'com.android.support:support-v4:18.0.0'
compile 'com.android.support:appcompat-v7:18.0.0'
}

现在我试图导入支持库API,在我的code扩展ActionBarActivity,
然而,这就是出现了

Now I'm trying to import the Support Library API and extend ActionBarActivity in my code, however, this is what showed up


这是不是它应该是

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

任何帮助吗?

推荐答案

我有同样的问题。我跟着这个步骤来解决它,这是Android工作室 - 工具 - > Android的 - >同步工程与摇篮文件

I have the same problem. I followed this step to solved it, in Android Studio - Tools -> Android -> Sync Project with Gradle Files.

编辑:
对不起,我忘了补充一点:
同步工程与摇篮文件在的遵循这个步骤进行:

Sorry, I forgot add this: After Sync Project with Gradle Files follow this steps:


    为您的项目
  • 右键点击鼠标并选择打开模块设置

  • Right mouse click for your project and select Open Module Settings


  • 之后,选择依赖标签


  • 在年底 - 塞莱茨您的库:

这应该工作。

这篇关于不能使用Android的工作室从Android的支持库导入ActionBarCompat的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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