在Ubuntu 18.04.3 LTS中运行sdkmanager后出现错误

时间:2020-05-02 13:08:55

标签: flutter java-8 ubuntu-18.04 flutter-dependencies android-sdk-tools

我在Ubuntu上遇到问题,但是每当我运行$ sdkmanager时,它总是给我这个错误。 这是错误:

~$ sdkmanager
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.

我使用.bashrc导出路径

sudo nano .bashrc

这是我的路径设置

export PATH="$PATH:/home/khaleephs/flutter/bin"
export PATH="$PATH:/home/khaleephs/commandlinetools/tools/bin"
export ANDROID_HOME="/home/khaleephs"
export ANDROID_SDK_ROOT=/home/khaleephs
export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_211
export PATH=$PATH:/usr/lib/jvm/jdk1.8.0_211/bin

我运行以下命令,看起来一切正常

echo $JAVA_HOME
echo $PATH

输出

khaleephs@khaleephs:~$ echo $JAVA_HOME
/usr/lib/jvm/jdk1.8.0_211
khaleephs@khaleephs:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/khaleephs/bin:/usr/lib/jvm/jdk1.8.0_211/bin:/home/khaleephs/flutter/bin:/home/khaleephs/commandlinetools/tools/bin:/usr/lib/jvm/jdk1.8.0_211/bin
khaleephs@khaleephs:~$ 

我该如何解决此问题?

0 个答案:

没有答案