4

Everytime I run anything sdkmanager I keep on getting this error and i am completely unsure on what to do:

Warning: Could not create settings java.lang.IllegalArgumentException
   at
com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.<init>(SdkManagerCliSettings.java:428)
   at
com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.createSettings(SdkManagerCliSettings.java:152)
   at
com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.createSettings(SdkManagerCliSettings.java:134)
   at
com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:57)
   at
com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)

Usage:   sdkmanager [--uninstall] [<common args>]
[--package_file=<file>] [<packages>...]   sdkmanager --update [<common
args>]   sdkmanager --list [<common args>]   sdkmanager --licenses
[<common args>]   sdkmanager --version

With --install (optional), installs or updates packages.

By default, the listed packages are installed or (if already installed)
updated to the latest version. With --uninstall, uninstall the listed packages.

<package> is a sdk-style path (e.g. "build-tools;23.0.0" or "platforms;android-23").
<package-file> is a text file where each line is a sdk-style path of a package to install or uninstall.
Multiple --package_file arguments may be specified in combination with explicit paths.

With --update, all installed packages are updated to the latest version.
With --list, all installed and available packages are printed out.
With --licenses, show and offer the option to accept licenses for all available packages that have not already been accepted.
With --version, prints the current version of sdkmanager.

Common Arguments:

    --sdk_root=<sdkRootPath>: Use the specified SDK root instead of the SDK containing this tool

    --channel=<channelId>: Include packages in channels up to <channelId>.
                           Common channels are:
                           0 (Stable), 1 (Beta), 2 (Dev), and 3 (Canary).

    --include_obsolete: With --list, show obsolete packages in the
                        package listing. With --update, update obsolete
                        packages as well as non-obsolete.

    --no_https: Force all connections to use http rather than https.

    --proxy=<http | socks>: Connect via a proxy of the given type.

    --proxy_host=<IP or DNS address>: IP or DNS address of the proxy to use.

    --proxy_port=<port #>: Proxy port to connect to.

    --verbose: Enable verbose output.

* If the env var REPO_OS_OVERRIDE is set to "windows",   "macosx", or "linux", packages will be downloaded for that OS.

I have set the sdk as a path variable and I am running Java 8. If you have any insight whatsoever please let me know.

Martin Zeitler
  • 1
  • 19
  • 155
  • 216
Samrat Sahoo
  • 565
  • 8
  • 17
  • can you provide the exact command you executed. `sdk and the rest of the arguments` – DevZer0 Feb 28 '20 at 01:17
  • @DevZer0 I executed `sdkmanager --list` Here is my java version as well: `openjdk version "1.8.0_202" OpenJDK Runtime Environment (build 1.8.0_202-20190206132807.buildslave.jdk8u-src-tar--b08) OpenJDK GraalVM CE 1.0.0-rc16 (build 25.202-b08-jvmci-0.59, mixed mode)` – Samrat Sahoo Feb 28 '20 at 01:20
  • `The sdkmanager tool is provided in the Android SDK Tools package (25.2.3 and higher) and is located in android_sdk/tools/bin/.` are you using buildtools 25+ ? – DevZer0 Feb 28 '20 at 01:22
  • Yes, I am using the latest version of the Android SDK Tools Package – Samrat Sahoo Feb 28 '20 at 01:26
  • can you add `--verbose` to the command `sdkmanager --list --verbose` and share the output – DevZer0 Feb 28 '20 at 01:44
  • The same error came up when I added `--verbose` – Samrat Sahoo Feb 28 '20 at 01:57
  • yes but there is additional output. same error was expected, but the additional output could have clues. – DevZer0 Feb 28 '20 at 01:58
  • 2
    @DevZer0 fixed the error. Apparently it was something to do with the specific version of the Android SDK I was using. So I downloaded an older version. Thank you for your help! – Samrat Sahoo Feb 28 '20 at 03:21
  • Hi, which version are you using now? I having the same issue. – GeekSilva Mar 14 '20 at 17:00
  • @GeekSilva Android SDK version 28.0.3 – Samrat Sahoo Mar 14 '20 at 17:07
  • This is the SDK Tools version, right? Where can I get it in this version? – GeekSilva Mar 14 '20 at 17:11
  • The correct answer is to set the path to sdkmanager in a specific way. [Answered here.](https://stackoverflow.com/a/61176718/7648956) – psimpson May 05 '20 at 20:33

0 Answers0