无法解析符号 AppCompatActivity - 无法识别支持 ​​v7 库? [英] Cannot resolve symbol AppCompatActivity - Support v7 libraries aren't recognized?

查看:53
本文介绍了无法解析符号 AppCompatActivity - 无法识别支持 ​​v7 库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想弄清楚为什么我的 Android 工作室无法正确识别 AppCompat v7 库.下面的导入语句显示为灰色,并表示没有 support.v7.app 的包.以下是我的活动文件:

I'm trying to figure out why the heck my Android studio isn't recognizing the AppCompat v7 library correctly. The import statement below shows up as gray and says there's no package for support.v7.app. Below is my activity file:

import android.support.v7.app.AppCompatActivity;


public class XApplicationActivity extends AppCompatActivity

我的 build.grade:

My build.grade:

compile "com.android.support:appcompat-v7:22.0.0"
compile "com.android.support:support-annotations:$ANDROID_SUPPORT_VERSION"
compile "com.android.support:support-v4:$ANDROID_SUPPORT_VERSION"

我的项目设置:

minSdkVersion = 14
targetSdkVersion = 21
compileSdkVersion = 21
buildToolsVersion = "22.0.1"

所以我真的很困惑为什么这仍然给我带来问题.我已经尝试过的事情:

So I'm really confused as to why this is still giving me issues. Things I've tried already:

  • 清理/重建项目
  • 使缓存无效并重新启动
  • 检查十亿次以确保我安装了支持库(我绝对安装了最新的支持库和库)

有人知道任何修复吗?这花费了我很多时间,而且真的很令人沮丧.

Anybody know of any fixes? It's cost me a lot of time and it's really frustrating.

推荐答案

好的,我通过重建它来修复它,第四次执行 ./gradlew clean assemble ... Android Studio 是一个奇怪的东西

Okay, I fixed it by rebuilding it for doing a ./gradlew clean assemble for the fourth time... Android Studio is a weird thing

这篇关于无法解析符号 AppCompatActivity - 无法识别支持 ​​v7 库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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