IntelliJ IDEA 12 - New Android Application Module

2020-05-24 06:38发布

问题:

The problem I'm facing is a very simple one... I can't get IntelliJ IDEA 12 to help me with the creation of an Android application module (project).

After successfully installing IntelliJ IDEA 12 and making acquaintance between the IDE and both SDKs (Java and Android), when I run the "New Module wizard" and choose "Android application module" I receive an error message which states:

"Cannot find resource directory for module < blah >"

The IDE does not hang, or crash but I'm left with a half Android project which does not contain the mandatory file structure of any (straight forward, recommended) Android application.

Amongst other things:

  • the "res" folder is missing
  • and so is the activity which the wizard asked me about
  • and then there's no AndroidManifest.xml

Here's what the IDEA 12 Wizard creates:

and here's what the structure of the project should look like (in this particular case it's the work of an Eclipse - Android integration from a colleague's machine):

I've replicated the problem several times and it always happened in the same way.

It looks like something's broken in there and I've looked all over the Internet for an answer before finally deciding to ask this question.

I'm sure that all the required files and folders could be created manually but I would like the IDE to help me with this boilerplate stuff since I'm a beginner with Android development and there may be other things not working, behind the scenes, it this is the symptom.

In other words, I feel it would be very important for the wizard to create a working Hello World project. Any help would be greatly appreciated.

回答1:

I've had the same issue today, but resolved it by moving jdk from c:\program_files\java to c:\home\java and updating the system path to it.



回答2:

Remove java*.exe files which in C:\Windows\System32 folder.

It works



回答3:

I removed the java*.exe files from C:\Windows\System32 folder and add the JAVA_HOME in the path environment by my jdk path(in my case is C:\Program Files\Java\jdk1.6.0_45)