I’m trying to use Android Studio installed on windows with all the resources installed on wsl (gradle, jdk, sdk, project files…)
I’ve installed and configured everything as needed, but when im trying to build the project im getting an error
Executing tasks: [:app:assembleDebug] in project \wsl.localhostUbuntuhome...projects...
No traceback or anything but I’m also getting this warning under “Sync”
SDK location not found. Define a location by setting the ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local.properties file
The weird thing is that everything is indeed configured as it suggests.
My local.properties
file:
sdk.dir=\\wsl.localhost\Ubuntu\usr\lib\android-sdk
Things i did:
- Configured that android sdk path also through Android Studio settings
- Deleted local.properties file / .gradle folder / .idea folder
- Configured
ANDROID_SDK_ROOT
andANDROID_HOME
paths both in windows and in wsl - Changed both gradle versions and jdk versions to see if any version might be the problem
- Changed gradle home path to be in wsl (
/home/user/.gradle
) - Configured gradle jdk path to be the one installed in the WSL environment (
//wsl.localhost/Ubuntu/home/user/.jdks/jbr-17.0.12
)
Nothing works.
Something i noticed:
-
In the gradle settings page in the jdk path selection, there are the
JAVA_HOME
andGRADLE_LOCAL_JAVA_HOME
options, they aren’t pointing to the actual environment variable configured neither on windows and neither on WSL, so my first guess would be there is an issue with Android Studio trying to read the environment variables -
When i’m running
./gradlew assembleDebug
through the terminal, it succeeds
But now i see the warningsdk.dir property in local.properties file. Problem: Directory does not exist
I’ve been trying to solve it for almost a week now any help will be appreciated!