无法解析 AppCompatActivity [英] can't resolve AppCompatActivity

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

问题描述

重命名应用程序包名称后,Android Studio 显示此错误 can't resolve symbol AppCompatActivity

After renaming application package name, Android Studio displayed this error can't resolve symbol AppCompatActivity

我尝试过的事情:

  • 清理项目
  • 清理 Android Studio 缓存
  • 清理 Gradle 缓存
  • 重新安装 IDE
  • File-> 使缓存无效/重启

但没有任何帮助.项目构建成功,但我不能使用语法高亮.

But nothing really helped. The project build successfully, but I can not use syntax highlighting.

我使用了 com.android.support:appcompat-v7:23.1.1

截图

推荐答案

让我们一步一步来:使用

Lets get going step by step: first clean project by using

构建->清理

如果这没有帮助,那就使用你的第二把武器

if this doesn't helps then use your second weapon

文件>使缓存无效/重新启动...

File>Invalidate Caches/Restart...

但是当上述所有选项都不起作用时,真正的问题就开始了所以使用你的终极武器关闭项目并转到项目位置目录并删除

But the real problem begins when all the above options doesn't works so use your ultimate weapon close project and go to project location directory and delete

.idea

您现在可以再次打开您的项目.这对我有用,当您使用 VCS 时,问题最常出现.而且这个问题与android组件类无关,也与库有关,两者都显示相同的错误.

You can open your project now again. This worked for me and problem comes most often when you are working with VCS. And this problem is not associated with android component classes but also to the libraries, both shows the same error.

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

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