从IntelliJ 13获得此投诉:

8:15:48 PM Gradle '<project>' project refresh failed:
           SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
           Build file '/<project>/build.gradle' line: 20
           : Gradle settings

我试图在我能想到的每个目录中都对local.properties进行垃圾邮件发送,但仍然出现此错误。是什么赋予了?

最佳答案

local.properties文件位于项目的根目录下,与gradlewgradlew.batsettings.gradle和其他文件位于同一文件夹中。

此文件不应包含在源代码管理中。在(不正确地)将其包含在源代码管理中之后,然后在本地删除该文件后,Android Studio会自动为我重新创建该文件。

这是此文件的示例内容:

## This file is automatically generated by Android Studio.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
#Thu Aug 14 14:49:26 PDT 2014
sdk.dir=C\:\\Program Files (x86)\\Android\\android-studio\\sdk

请注意对Android Studio SDK安装位置的sdk.dir=引用(在不同的计算机上可能有所不同)。

10-07 19:12
查看更多