本文介绍了哪里local.properties去Android项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

闻听此事投诉的IntelliJ 13:

Getting this complaint from 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在每个目录中我能想到的,但仍然收到此错误。是什么给了?

I have tried to spam my local.properties in every directory I can think of but still getting this error. What gives?

推荐答案

local.properties 文件进入项目的根目录下,在相同的文件夹 gradlew gradlew.bat settings.gradle 和其他文件。

The local.properties file goes in the project's root level, in the same folder as the gradlew, gradlew.bat, settings.gradle and other files.

该文件不应该被包含在源代码控制。后(不正确),包括该源代码控制,然后删除本地文件,Android的Studio自动重新创建该文件对我来说。

This file should not be included in source control. After (incorrectly) including this in source control, then deleting the file locally, Android Studio re-created the file for me automatically.

下面是该文件的示例内容:

Here is the example content of this file:

## 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

注意 sdk.dir = 引用到Android工作室SDK安装的位置(这可能是在不同的机器不同)。

Note the sdk.dir= reference to the location of the Android Studio SDK installation (which may be different on different machines).

这篇关于哪里local.properties去Android项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-14 00:13