Android Hello World in IntelliJ 12 - Cannot find android.app.Activity class

See below. I have a feeling that my SDKs are not configured correctly, but I'm not sure how to solve it. I tried Googling for answers, but no one had this exact problem.

Maybe I have the wrong version of Java? It seems that the two SDKs may be conflicting.

I made this project through:

  • Create a new project
  • Android> Application module
  • Default and finish

error in IntelliJ


Edit: see screenshot. I have earned. All I did was create a new project and re-select the Android SDK. I still think this happened because I added too many SDK / JDKs for the first time. I think all you need is an Android SDK and you don’t need to add regular Java.

enter image description here

+8
android intellij-idea
source share
2 answers

I tried what for3st offered to no avail, but I heard other places you should use JDK 1.6 for IntelliJ IDEA in other places, so you can do it here . In addition, you install the SDK by going to "File" β†’ "Project Structure" β†’ "Platform Settings" β†’ "SDK"

In the end, I also switched from Android 2.2 to 2.3.3 (api 10), and this made it work. I don't have a good idea why it doesn't work on 2.2, but since I just need a primer, I'm fine with that.

+1
source share

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

I downloaded the Android SDK as a zip file and did not transfer it to /opt .

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

Removing the SDK, fixing the permissions issue in the SDK and creating a new link in IntelliJ has been fixed.

+1
source share

All Articles