Error configuring Android Sdk on Linux

Asked

Viewed 1,456 times

1

The operating system is Linux Mint

When inserting:

~/Android/Sdk/tools/bin/sdkmanager "platform-tools" "platforms;android-27" "build-tools;27.0.3"
acontece o seguinte erro:

I’m cracking my head here...

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.
  • JDK is installed?

  • You are my comrade. If you download all the tool of Android Studio advance?

  • Yeah, maybe it works. I was struggling with that same problem today. In some posts I saw that this could be a problem with the summer of SDK Tools. Which is what this guy said in this post https://stackoverflow.com/questions/60443891/sdkmanager-command-line-execution-error-linux

  • Then I downgrade it. I got the links in this post https://stackoverflow.com/questions/43049883/android-sdk-tools-older-version-with-working-android-tool .

  • Now I’m trying to build here. For now it’s working.

  • Yeah, it worked. Try it on.

  • Opa, now was my comrade. Ball show friend. I thank you for this moral. Strong hug...

  • I’m glad it worked out.

  • Apparently this is an error with the SDK tools itself, downgrade the version and make sure it works http://dl-ssl.google.com/android/repository/tools_r25.2.5-macosx.zip - Macos X http://dl-ssl.google.com/android/repository/tools_r25.2.5-macosx.zips. - Windows http://dl-ssl.google.com/android/Repository/tools_r25.2.5-linux.zip - Linux

  • I hope I can help others with the great experience. The comrade, who by private comment provided me with help successfully by the following link: https://stackoverflow.com/questions/43049883/android-sdk-tools-older-version-with-working-android-tool

Show 5 more comments

2 answers

1

Luka, I tried to execute the following commands.

sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt-get install openjdk-8-jdk

After you finish check that Java is installed on your machine.

java -version

If you have other versions of Java installed on the machine, you need to set 8 to default:

sudo update-alternatives --config java

To emulate, you may need the 32bit libs

sudo apt-get install gcc-multilib lib32z1 lib32stdc++6

Content taken from Rocketseat material. https://docs.rocketseat.dev/ambiente-react-native/android/linux

I hope I’ve helped.

  • Hey, it’s Rafael, all right? So my comrade, it was on the basis of this documentation that I guided myself and guided myself in this case, but when trying to do it on a laptop gave me this mistake. Already on desktop flowed normally.

  • Then do the following steps. ;~/Android/Sdk/tools/bins/ E run ./sdkmanager --sdk_root=${pwd} --licenses Then test again, if it doesn’t work, run the command as sudo

0

According to the documentation should be correct, but I had the same problem. I solved it as follows:

Move the "tools" folder into a folder called "cmdline-tools". Your command would look like this:

/Android/Sdk/cmdline-tools/tools/bin/sdkmanager "platform-tools" "platforms;android-27" "build-tools;27.0.3"

The above command should work without any errors, but I’m guessing your environment variables are set to something like this:

export JAVA_HOME=CAMINHO_ANOTADO_COM_SUA_VERSÃO
export ANDROID_HOME=~/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools

If you want a more detailed answer, see the discussion here (in English)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.