16

I've just installed IntelliJ IDEA 10.0.0.2 Community edition
I've installed Android SDK ... (C:\Program Files\Android\android-sdk-windows)

I want to make a new android project, so I a create a new project, select Android Module, next , next...

Then when i need to choose the JDK, I go to the android folder, and when i try to choose it, I get this error:

The selected directory is not a valid home for JSDK

What am I doing wrong ? what can i do to fix this ?

I Installed android SDK with all the updates
When I choose IntelliJ IDEA Plugin SDK i get:

The selected directory is not a valid home for IntelliJ IDEA Plugin SDK

EDIT:

Still not solved...
I've already chose the SDK itself and chose android 2.2 Platform when creating the project.

Can't load the JDK files. So i won't me compile, i get this error

Cannot start compiler: the SDK is not specified for module "blah". Specify the SDK at Project Structure dialog.

14 Answers 14

25

To develop Android applications in IntelliJ IDEA you need to set both Java SDK (JSDK) and Android SDK:

You also need to run SDK Manager application and download Android platforms which you are going to use.

Note that you can detach all the jars from the JSDK configuration in IDEA if you are going to use it only for Android, this will help with the code completion so that only classes available in Android will be suggested by the IDE.

I also recommend to read the following tutorials:

EDIT:

Configuring project's link has been updated

6
  • Still gives me the same error... I've been to those pages already. I'll try to download everything from SDK Manager and see if it will work then. Feb 19, 2011 at 23:44
  • 1
    Don't mix up Android SDK and JSDK.
    – CrazyCoder
    Feb 19, 2011 at 23:51
  • ok, so how do i add the SDK so i can open a new android project ? Feb 20, 2011 at 1:25
  • I've linked the help sections in my reply. Android SDK/Platform is configured in the Android Facet.
    – CrazyCoder
    Feb 20, 2011 at 2:09
  • So why Set up Your Project JDK and Libraries help section linked by me didn't help but the vague reply of Szabolcs Berecz with Linux JDK path was more helpful?
    – CrazyCoder
    Feb 20, 2011 at 13:02
8

JSDK is the Java SDK. On my Debian it's under /usr/lib/jvm/java-6-sun

1
  • 6
    C:\Program Files\Java\jdk1.6.0_24\ Feb 20, 2011 at 11:22
7

My installation path was "C:\Users\User\AppData\Local\Android\android-sdk." That confused IDEA since it doesn't seem to be able to see hidden folders, even when typing in the full path. Bummer...I fixed it though, by setting AppData as visible.

1
  • 1
    This was my problem too. Android SDK installs to AppData if you say 'only for this user' during installation, but IDEA can't see it there
    – codeulike
    Sep 6, 2012 at 18:31
5

I just wasted a whole lot of time on this problem. My work station is running IntelliJ Ultimate 11 on Windows 7 64-bit. I was setting up my first Android project. Therefore, no SDKs were configured. First I selected the JDK, which was a no-brainer (C:\ProgramFiles (x86)\Java\jdk1.6.0_30). Next comes the part where you need to specify the Android SDK. First you click the elipsis ("...") and then click "Add New". Now here's the kicker... If you look carefully at the dialog box, you'll notice that "Configure new JSDK" is highlighted by default. What you need to do is change the selection to "Android SDK". Now you can select the directory of your Android SDK and you won't get that stupid error message.

I literally wasted about a half an hour before I realized why the app kept telling me "This is not a valid SDK directory." Hopefully this will help someone else having the same problem.

Don here: I had the same trouble in Windows 64 with 11.1.2 and 64bit java. found that only by clicking on the left window could I register my Android SDK.

3

When you first create Android project/module, you must choose JDK, for this click "+" and select "JSDK" in menu, then select where your Java SDK is, for instance "c:\Program Files\Java\jdk1.6.0_20". Then click "Next" and in "SDK Properties" panel click "New" and select path to your Android SDK (a directory where "SDK Manager.exe" is).

2

Click the + symbol in the left most pane in the Select android sdk window during the creation of the project and then select the android SDK (default= c/program files/android/android-sdk)

1

I had a real hard time seeing how to do this on a mac, since you can't download the jdk from sun's site

@Szabolcs Berecz @Yochai On a mac, you'll need to get the source as described here:

or just jump to the download here:

Then it stored in this location: 1.6.x /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/src.jar

1

If you right click in the leftmost window you can create a new Android Plugin or some such. I was just fighting with this myself. I have never used IntelliJ before and really their docs are out of date. Apparently not up to the current version.

1

In the JDK part you need to choose the JAVA JDK that was downloaded. (not the android)

C:\Program Files\Java\jdk1.6.0_24\

1

Make sure you have installed JDK 1.5 or 1.6 (1.7 is not works for some reason with Android SDK). I had the same problem ("The selected directory is not a valid home for Android SDK"), but after installing 1.6 JSDK - it`s work for me.

1

I've got the same problem with version 12 on linux, Android module does not show java sdk location and android sdk location selection fails because java sdk is not set. I've solved by making a java project, that lets me select java sdk and android sdk (strange right?), after making such a project I can make an android project because android sdk is now configured

1
  • 1
    I had same problem under linux with IDEA 12. Could not select Android SDK "The selected directory is not a valid...". Fixed either by making the Android SDK directory writable or by creating a fresh IDEA project - I do not know, what really helped.
    – geekQ
    Jun 20, 2013 at 16:23
0

I've spent 30 minutes solving a foolish problem

For IntelliJ & Android on Linux.

If the "Android SDK" Menu comes up with a red 'No Android SDK' Click the browse button to the RIGHT of the drop down. - Its a different layout in Linux to Windows.

0

In my case, I needed to add support for android, so, I searched for android in the plugins settings.

-1

Fixed! I needed to run IntelliJ as Administrator IDEA. Now it will approve my Android SDK directory of "C:\Program Files (x86)\Android\android-sdk"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.