Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ Idea fails to create a new Android application project

I am using IntelliJ Idea 12.1.4 Community Edition in Windows 7 which contains Android Support by default.

I can import Android projects which were created using Eclipse and they are working fine in IntelliJ. But when I tried to create a new Android Project in IntelliJ it failed to do so. It is showing a dialog box

Cannot find resource directory for module [ProjectName]

Then in Android Console:

The project wasn't generated by 'android' tool.

'C:\Windows\system32\java.exe' is not recognized as an internal or external command, operable program or batch file.

Invalid path

ERROR: SWT folder '' does not exist.

Please set ANDROID_SWT to point to the folder containing swt.jar for your platform.

I have tried both answers from the following questions:
intellij IDEA - create android app failed
IntelliJ IDEA 12 - New Android Application Module wizard fails with "cannot find resource directory for module"
But both answers has failed to solve this.

Edit: Screeshots of SDKs' path in IntelliJ Idea

JDK Path:
enter image description here

Android SDK Path:
enter image description here

like image 359
krishh Avatar asked Aug 06 '13 08:08

krishh


1 Answers

Thank you @CrazyCoder for your answer as in comment.

I added a new variable in Environment Variables called JAVA_HOME with JDK path - C:\Program Files\Java\jdk1.7.0_25 as value.

Now IntelliJ Idea creating new Android Projects successfully.

like image 104
krishh Avatar answered Oct 21 '22 14:10

krishh