【发布时间】:2019-10-09 18:40:02
【问题描述】:
我已经安装了适用于 Windows 的 SDK 工具并尝试运行它;然而,无论我运行什么(sdkmanager、sdkmanager --list、sdkmanager --version、sdkmanager asdoifjasodjfoas),它总是打印相同的文本块:
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.
我从https://developer.android.com/studio/ 的“仅限命令行工具”部分安装了 sdkmanager。我当前的 Java 版本是 Java 9(jdk-9.0.1 和 jre-9.0.1)。
如果这意味着什么,我在运行程序时遇到了一些问题 (java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema),所以我将 sdkmanager.bat 中的 DEFAULT_JVM_OPTS 标志更改为 set DEFAULT_JVM_OPTS="-Dcom.android.sdklib.toolsdir=%~dp0\.. -XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee",这使我能够运行程序而不会出现任何错误,但也会导致这个问题的主要问题。
【问题讨论】:
-
你解决了吗?如果解决了,请回答您自己的问题
-
@ajinzrathod 抱歉,我已将问题标记为已解决。我只是按照接受的答案中的步骤进行操作。
标签: java android android-sdk-tools android-sdk-2.3