local.properties

Android Studio默认生成的local.properties如下所示。

  1. ## This file is automatically generated by Android Studio.
  2. # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
  3. #
  4. # This file should *NOT* be checked into Version Control Systems,
  5. # as it contains information specific to your local configuration.
  6. #
  7. # Location of the SDK. This is only used by Gradle.
  8. # For customization when using a Version Control System, please read the
  9. # header note.
  10. sdk.dir=/Users/xuyisheng/Library/Android/sdk

在Android Studio自动创建的工程中,IDE自动配置了local.properties,并设置了sdk.dir属性。从命名就可以看出,这里配置了Android Gradle插件所需要使用的Android SDK的路径。由于已经设置了Android_Home环境变量,所以IDE能够自动生成这个配置文件。通常情况下都不需要修改这个配置文件,除非你一定要重新指定一个SDK的路径。