0

I create an android project on the command line, with gradle. But without Android Studio. I get a error message:

The SDK directory 'C:\Android_SDK\sdk' does not exist

As cause I find the entry in local.properties:

sdk.dir=C\:\\Android_SDK\\sdk

I found further, this entry should e.g. be changed to:

sdk.dir=C\:\\Users\\<realusername>\\AppData\Local\\Android\\sdk

or according :

sdk.dir=C\:\\AndroidStudio\\SDK

and something like that. <realusername> is to be replace with my user name. But all that directories does not exist. If I create a directory, I get the error:

failed to find target with hash string 'android-23' in: C:\Users\<realusername>\AppData\Local\Android\sdk

That means in this folder are some files and folders expected.

My question is, how can I detect which directory on my system corresponds to sdk.dir? Or which files and folders are expected for gradle when specifying the directory for sdk.dir? So I can determine which directory to name.

I have already installed numerous binaries and libraries necessary for Android. And I suspect I may already have the files I need. Therefore I do not want to install the Android Studio package additionally. If I know what content is expected from sdk.dir, I can also specify the path correctly.

gotwo
  • 429
  • 5
  • 11

1 Answers1

0

I determined the identification as follows:

Determination by content:

  • Search for the file android.bat. The root folder of tools/android.bat is the sdk.dir folder.
  • Or search for the directory build-tools with (the build-tools) subdirectories like 23.0.1, 26.0.1, or something like that. The parent directory of build-tools is the sdk.dir directory.

Print out the sdk.dir location:

Run android.bat which is located in the /tools folder. This opens the SDK Manager GUI. On the top left area of the Manager you can check the hint "SDK Path:". There is written the absolute path to the sdk.dir.

gotwo
  • 429
  • 5
  • 11