gpt4 book ai didi

android - 错误 : Unknown argument --licenses flutter doctor --android-licenses

转载 作者:行者123 更新时间:2023-12-05 00:19:08 25 4
gpt4 key购买 nike

我尝试用vscode安装android SDK来写flutter。但是,每当启动 android 模拟器时,它都会要求许可证。但是每当我使用命令 flutter 医生安卓许可证时。它给了我这个错误。我在用,
安卓 SDK 平台工具 - 29.0.6
ANDROID SDK 构建工具 - 29.0.3
安卓 7 (API:24)

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.22.1, on Linux, locale en_US.utf8)
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
✗ Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/linux#android-setup for more details.
[!] Android Studio (not installed)
[✓] VS Code (version 1.50.0)
[!] Connected device
! No devices available

! Doctor found issues in 3 categories.
我尝试了许多 StackOverflow 解决方案,但都没有成功。也许过时了。
 flutter doctor --android-licenses
Error: Unknown argument --licenses
Usage:
sdkmanager [--uninstall] [<common args>] \
[--package_file <package-file>] [<packages>...]
sdkmanager --update [<common args>]
sdkmanager --list [<common args>]

In its first form, installs, or uninstalls, or updates 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.
In its second form (with --update), currently installed packages are
updated to the latest version.
In its third form, all installed and available packages are printed out.

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.

* If the env var REPO_OS_OVERRIDE is set to "windows",
"macosx", or "linux", packages will be downloaded for that OS.
那么如何激活 android SDK 的许可证呢?

最佳答案

我在运行 flutter doctor --android-licenses 时遇到了同样的问题.而且我在不使用 Android Studio 的情况下安装了 android SDK。
这是我为使其工作而采取的步骤

  • 我去了android studio download page并向下滚动并下载我的操作系统(windows)的命令行工具
  • 然后我把它提取到android-sdk目录
  • 我创建了一个名为 latest 的新文件夹里面 cmdline-tools并移动了cmdline-tools的内容给它。

  • 之后我尝试运行 flutter doctor --android-licenses然后它没有错误地工作并在我的设备上运行它没问题。

    关于android - 错误 : Unknown argument --licenses flutter doctor --android-licenses,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64307347/

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