How to get Android Studio STOP to generate local.properties?

I set the ANDROID_HOME environment variable which points to my location of the Android SDK. However, every time I open my project in Android Studio, it places the local.properties file in the root of my project and copies its SDK location from ANDROID_HOME to this file. I want Android Studio to use ANDROID_HOME directly, without generating local.properties .

Why? I am on Windows 10 and I am using Bash for Windows. I want to run the command line using Bash while starting Android Studio from Windows. To do this, I need two ANDROID_HOME environment ANDROID_HOME , one for Windows, one for Bash. This is due to the fact that although they point to the same (Windows) android SDK, the format is different, for Windows it is C:\Users\me\Android SDK , and for Bash it /mnt/c/Users/me/Android SDK . When Android Studio creates local.properties with a Bash window pass, it becomes broken, as it seems that local.properties takes advantage over ANDROID_HOME , so I need to remove it manually.

+6
source share
1 answer

Android will always generate this file when Gradle synchronizes it. But if you delete it and define the environment variables ANDROID_HOME and ANDROID_NDK_HOME, each time it is generated, it will read ANDROID_HOME and ANDROID_NDK_HOME.

If you want to build your project on many computers with different home folders, just keep local.properties out of the control of the original version.

0
source

Source: https://habr.com/ru/post/1274834/


All Articles