Trying Android development with command line tools only (I am not installing Android Studio).
The following error occurs when I run ./gradlew build --warning-mode all
:
What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
SDK location not found. Define a valid SDK location with an ANDROID_HOME environment variable or by setting the sdk.dir path in your project's local properties file at '/Users/folder1/android-projects/genisis/local.properties'.
From whatever I have seen over here, I understood that I have to specify the path of android sdk to a variable named ANDROID_HOME
or to sdk.dir
in local.properties
.
Now the thing is, both have been done and I am still struck in this eternal suffering caused by gradlew
.
Is it that I have not installed Sdk properly?
How did I install Sdk and its stuff?
1.went to the :Android studio download website
2. I Scrolled down to the bottom to the “Command line tools only” section. Since I am using Mac-os (intel x86 chips) now, I have downloaded the Mac’s zip file.
3. extracted the zip file, went into cmdline-tools/latest/bin, launched sdkmanager and downloaded the following: platform-tools, build-tools, platforms;android-35
I followed this tutorial to do the above.
Now my directory looks like this
Android:
/build-tools
/cmdline-tools
/licences
/platform-tools
/platforms
platforms
folder contains the folder named android-35 which I belive to be the sdk.
So my environment variables look like this:
export ANDROID_HOME=Users/folder1/Android
export PATH=$PATH:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools
export ANDROID_SDK_ROOT=Users/folder1/Android
all are defined in ~/.bash_profile
and my sdk.dir
in local.properties
have this value : Users/folder1/Android/
What abomination have happened and how can I recover from this? Is the only solution is to go back to android studio
What did I try and what was I expecting? uhhh… I don’t know… I don’t know what to do or what to try
what did I expect? all I expected was an apk to be outputted
What makes my question different from other questions with the same error text?
Its because I did all the ones that were mentioned(as far as I have read. If you find any post that has a new solution please let me know) and I am still struck with the same error
as you can see the contents of the ~/.bash_profile that I have provided above, can see that I have a variable named ANDROID_HOME.
And Also I have mentioned that I updated the sdk path in sdk.dir in local.properties.