安卓的Hello World中的IntelliJ 12 - 找不到android.app.Activity类 [英] Android Hello World in IntelliJ 12 - Cannot find android.app.Activity class

查看:229
本文介绍了安卓的Hello World中的IntelliJ 12 - 找不到android.app.Activity类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请参见下文。我有我有配置不正确的软件开发工具包的感觉,但我不知道如何解决它。我试图谷歌搜索的答案,但没有人有这个确切的问题。

难道我错了Java版本可能?这似乎是两个的SDK可能互相冲突的。

我通过做这个项目

  1. 创建新项目
  2. 安卓>应用模块
  3. 默认值和完成


编辑:见截图。我得到它的工作。我所做的只是创建一个新项目,并重新选择Android SDK。我还在想这是因为我加了太多的SDK / JDK中的第一次。我认为,所有你需要的是Android SDK中,并不需要添加普通的Java一个了。

解决方案

我有完全相同的问题,而导致它的条件是相当不寻常的。

我下载了Android SDK作为一个zip文件和未抽提成 / OPT

不过,权限不允许普通用户输入的所有目录或执行所有文件......所以,当的IntelliJ索引的SDK只拿起 RES 罐子。 ..从不添加源库路径!

删除SDK,在SDK固定的权限问题,并创造的IntelliJ一个新的参考固定它。

Please see below. I have a feeling I've got the SDKs configured incorrectly, but I'm not sure how to solve it. I tried Googling for answers but no one had this exact problem.

Do I have the wrong Java version maybe? It seems like the two SDKs might be conflicting with each other.

I made this project via:

  1. Create New Project
  2. Android > Application Module
  3. Defaults and Finish


Edit: See screenshot. I got it working. All I did was create a new project and re-select the Android SDK. I'm still thinking it was because I added too many SDKs/JDKs the first time. I think all you need is the Android SDK and don't need to add the normal Java one too.

解决方案

I had exactly the same problem, but the conditions leading up to it are quite unusual.

I downloaded the Android SDK as a zipfile and unextracted it into /opt.

However, the permissions did not allow normal users to enter all directories or execute all files... so when IntelliJ indexed the SDK it only picked up the res jar... and never added the sources to the library path!

Deleting the SDK, fixing the permissions problem in the SDK, and creating a new reference in IntelliJ fixed it.

这篇关于安卓的Hello World中的IntelliJ 12 - 找不到android.app.Activity类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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