android - Flutter 找不到 ANDROID_HOME 路径

标签 android android-studio flutter ubuntu

我在检测 ~/.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/

    相关文章:

    Flutter 总是重启而不是热重载

    flutter - Flutter 中未定义的类 'AuthResult'

    android - 冒号编码(:) with Google Cloud Endpoints, Android Studio

    android - 小部件类型旁边的字母数字是什么?

    google-maps - 如何在 flutter google map 上添加动态多个标记?

    java - 从应用程序内永久添加按钮

    android - ADB 执行输出不起作用

    android - Spring RestTemplate : post both an image and an object at the same time

    Android XML 绘图缩放

    android-studio - Android Studio 可以在我 Ctrl+F4 关闭当前文件后转到上一个打开的文件吗?