gpt4 book ai didi

android - Flutter 找不到 ANDROID_HOME 路径

转载 作者:行者123 更新时间:2023-12-04 18:49:36 27 4
gpt4 key购买 nike

我在检测 ~/.bashrc 中的 ANDROID_HOME 时遇到了麻烦
当我 flutter doctor 时出现此错误:

    Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.20.2, on Linux, locale en_US.UTF-8)
[✗] Android toolchain - develop for Android devices
✗ ANDROID_HOME = /usr/lib/android-sdk/cmdline-tools/tools/bin
but Android SDK not found at this location.
[!] Android Studio (not installed)
我使用 ls $ANDROID_HOME cd 进入 ANDROID_HOME ,然后 ls -la给我:
i992@paschal:/usr/lib/android-sdk/cmdline-tools/tools/bin$ ls -la
total 48
drwxr-xr-x 2 root root 4096 Aug 24 14:56 .
drwxr-xr-x 4 root root 4096 Aug 24 14:55 ..
-rwxr-xr-x 1 root root 5322 Aug 24 14:55 apkanalyzer
-rwxr-xr-x 1 root root 5313 Aug 24 14:55 avdmanager
-rwxr-xr-x 1 root root 5281 Aug 24 14:55 lint
-rwxr-xr-x 1 root root 5310 Aug 24 14:55 screenshot2
-rwxr-xr-x 1 root root 5320 Aug 24 14:55 sdkmanager
这证实了 sdkmanager 存在。知道为什么 flutter 没有捡起来吗?
~/.bashrc 路径配置:
export ANDROID_HOME=/usr/lib/android-sdk/cmdline-tools/tools/bin

最佳答案

尝试将 SDK 位置添加到环境变量。我遇到了同样的错误,但随后将以下路径添加到环境变量对我有用。

  • D:\Sdk\cmdline-tools\latest\bin
  • D:\SDK\平台工具
  • 关于android - Flutter 找不到 ANDROID_HOME 路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63556896/

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