gpt4 book ai didi

java - SDKmanager : Warning: Could not create setting. java.lang.IllegalArgumentException

转载 作者:行者123 更新时间:2023-12-01 09:45:33 25 4
gpt4 key购买 nike

我试图在我的 Ubuntu 上安装 androidSDK,但是当我尝试在 tools/bin/sdkmanager 文件夹上运行 SDK 管理器时,我收到以下消息:

我的 Ubuntu 是最近安装的,除了 Java 8 和 Android Studio 之外什么都没有。

我的 SDK 文件夹是默认的 ~/Android/Sdk。

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. ```

最佳答案

在弄乱了控制台之后,我想我发现了发生了什么。
显然 SDK 定位 SDK 安装文件夹的方式存在错误。

所以我需要做的就是使用 来指定它--sdk_root=${ANDROID_HOME} 使用 导出路径后导出 ANDROID_HOME=~/Android/Sdk

所以完整的命令是是的 | ~/Android/Sdk/tools/bin/sdkmanager --sdk_root=${ANDROID_HOME} --version

从另一个帖子得到解决方案:Android Command line tools sdkmanager always shows: Warning: Could not create settings

关于java - SDKmanager : Warning: Could not create setting. java.lang.IllegalArgumentException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60730615/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com