简体   繁体   English

找不到android.Activity类intellij IDEA

[英]can't find android.Activity class intellij IDEA

Yesterday my laptop got turned off, because I forget to plug it to the power source. 昨天我的笔记本电脑被关闭了,因为我忘了把它插上电源。

Now I turn on my laptop and see an error in the bottom of the Run windows, when I attempt to run my project: 现在,当我尝试运行项目时,打开笔记本电脑,看到运行窗口底部出现错误:

Error:Cannot find android.app.Activity class 错误:找不到android.app.Activity类

And I tested this and this way can't solve my problem Android Hello World in IntelliJ 12 - Cannot find android.app.Activity class 我测试了这个并且这种方式无法解决我在IntelliJ 12中的Android Hello World问题- 找不到android.app.Activity类

Edit: i use this answer, and it's work for me: 编辑:我使用这个答案,它对我有用:

https://stackoverflow.com/a/28369514/2003342 https://stackoverflow.com/a/28369514/2003342

maybe invalidate IDEA cache could help? 也许无效的IDEA缓存有帮助吗? Files -> Invalidate cache and restart -> Invalidate and restart 文件 - >使缓存无效并重新启动 - >无效并重新启动

Faced similar problem. 面临类似的问题。 Tried restarting, it didn't work. 尝试重新启动,它没有工作。 But the problem occurred when I changed the installation path for SDKs. 但是当我更改SDK的安装路径时出现问题。 So reinstalled with default path, everything worked fine. 所以重新安装默认路径,一切正常。 Hope it helps. 希望能帮助到你。

Haven't used IntelliJ in a while, I have had this problem before and it's usually a case of a missing reference somewhere . 以前没有使用过IntelliJ,之前我遇到过这个问题,而且通常是某个地方缺少参考的情况。

Try removing the old Android SDK from the program and adding it back. 尝试从程序中删除旧的Android SDK并将其添加回来。 If that doesn't work, try reinstalling everything, with a fresh SDK from the Google site. 如果这不起作用,请尝试使用Google网站上的新SDK重新安装所有内容。 That should fix it for you. 那应该为你解决。

Download and reinstall. 下载并重新安装。 Simplest fix. 最简单的修复。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM