[英]Upgrade IntelliJ to 10.5 and Android build fails Android SDK not specified
I just recently updated my IntelliJ Idea installation on my Mac to 10.5. 我刚刚将Mac上的IntelliJ Idea安装更新到10.5。 I had an Android project that I was working on in 10.0.3 and everything was working great. 我有一个我在10.0.3中工作的Android项目,一切都运行良好。 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. 听起来IntelliJ不知道Android SDK的位置。
Here is a step by step: 这是一步一步:
That should be it. 那应该是它。 Good luck! 祝好运!
Image added 图片添加
As Neil Traft suggests, you also have to make it default project SDK as well. 正如Neil Traft建议的那样,你也必须将它作为默认项目SDK。
I was very confused by this as well. 我也很困惑。 I was missing the android sdk under platform settings. 我在平台设置下错过了android sdk。
After adding this configuration, it still didn't work until I restarted Intelli-J. 添加此配置后,它仍然无法工作,直到我重新启动Intelli-J。 Very confusing. 很混乱。
Please note that Android SDK configuration has changed in 10.5. 请注意,Android SDK配置在10.5中已更改。 Refer to the blog for details. 有关详细信息, 请参阅博客 。
I got this same error when creating a new project with LibGDX 1.9.4 with the IntelliJ project option and opening it. 使用IntelliJ项目选项创建一个带有LibGDX 1.9.4的新项目并打开它时,我遇到了同样的错误。 Many of these answers are getting old, so here is confirmation from 2016! 其中许多答案都在变老,所以这是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: 对我有用的解决方案是进入模块设置并更改为Android SDK而不是Android模块的默认Java SDK:
Choose the appropriate Android SDK instead of the Java SDK. 选择适当的Android SDK而不是Java SDK。
I was able to run the project after the Android SDK was set. 设置Android SDK后,我能够运行该项目。 Thanks to @nicholas.hauschild for guidance on this solution! 感谢@ nicholas.hauschild对此解决方案的指导!
IntelliJ IDEA 2016.2.4 Build #IC-162.2032.8, built on September 9, 2016 JRE: 1.8.0_112-release-b343 x86
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.