I just recently updated my IntelliJ Idea installation on my Mac to 10.5. I had an A开发者_JAVA百科ndroid project that I was working on in 10.0.3 and everything was working great. Now when I try to build the project I am getting an Error:
Information:Compilation completed with 1 error and 0 warnings
Information:1 error
Information:0 warnings
Error:Android SDK is not specified for module Project_Android
It sounds like IntelliJ doesn't know where the Android SDK is.
Here is a step by step:
- From your existing project, go to 'File' -> 'Project Structure'
- Click 'Modules' entry from the 'Project Settings' group (on the left side)
- Click 'Android' module for your project
- Click 'New' where it says 'Android Platform'
- Point it to the Android SDK location that you have locally.
- Select an API version.
- Click 'Apply'
That should be it. Good luck!
Image added
As Neil Traft suggests, you also have to make it default project SDK as well.
Please note that Android SDK configuration has changed in 10.5. Refer to the blog for details.
I was very confused by this as well. I was missing the android sdk under platform settings.
After adding this configuration, it still didn't work until I restarted Intelli-J. Very confusing.
I got this same error when creating a new project with LibGDX 1.9.4 with the IntelliJ project option and opening it. Many of these answers are getting old, so here is confirmation from 2016!
The solution that worked for me was to go into the module settings and change to the Android SDK instead of the default Java SDK for the Android module:
- Right click on the project and select Open Module Settings.
- Select Modules under Project Settings.
- Select the Android module.
- Select the Dependencies tab.
Choose the appropriate Android SDK instead of the Java SDK.
- If the desired Android SDK is not present, go to the SDKs tab under Platform Settings and add the new Android SDK via the '+' button.
I was able to run the project after the Android SDK was set. Thanks to @nicholas.hauschild for guidance on this solution!
IntelliJ IDEA 2016.2.4
Build #IC-162.2032.8, built on September 9, 2016
JRE: 1.8.0_112-release-b343 x86
精彩评论