My gradle build is failing with the following error:
FAILURE: Build failed with an exception.
- What went wrong: A problem occurred configuring project ':app'. SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at '/home/ubuntu/hello_world_android/local.properties'.
This issue is in fact resolved by adding a local.properties with "sdk.dir = /opt/android-sdk-linux" to the project. However since this is intended to be used as a build machine I'd like to avoid needing to create that file for each project and instead use an environment variable. I've tried setting both ANDROID_SDK_ROOT and ANDROID_HOME to /opt/android-sdk-linux, however I keep getting the same error so long as it is not set in local.properties.
Is there any way around needing this local.properties file?
ANDROID_HOME
added to all users? It may be added only to the current user, or you might need to restart the machine or Studio. – Ahmad Sattoutenv
orprintenv
– Ahmad Sattout