【发布时间】:2018-04-16 10:24:34
【问题描述】:
当我尝试从终端运行 flutter doctor 时,它显示:-
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.2.8, on Linux, locale en_IN)
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
[✓] Android Studio (version 3.0)
[✓] Connected devices (1 available)
• No issues found!
当我尝试从 Android Studio -> pubspec.yaml -> pub_action:flutter doctor 运行时,它显示:-
[✓] Flutter (Channel beta, v0.2.8, on Linux, locale en_IN)
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.io/setup/#android-setup for detailed instructions).
If Android SDK has been installed to a custom location, set $ANDROID_HOME to that location.
[✓] Android Studio (version 3.0)
[✓] Connected devices (1 available)
! Doctor found issues in 1 category.
-我无法从 android studio 本身运行简单的颤振项目,我已经尝试并从 ~/.bashrc 设置路径仍然没有工作,任何帮助将不胜感激。提前致谢
当我尝试以下命令时:-
echo $ANDROID_HOME
它给了我正确的 sdk 路径:-
/home/hardy/SDKVRUNDA/Sdk/
在 echo $ANDROID_HOME 中是准确的 local.properties
【问题讨论】:
-
在 AS 的终端中,
echo $ANDROID_HOME得到什么输出? -
实际上我发现“Android_HOME”已被弃用,因此将其设置为“ANDROID_SDK_ROOT”@GünterZöchbauer
-
ANDROID_HOME应该仍然有效。如果没有,可能还有其他问题。与您的评论相关的链接github.com/flutter/flutter/issues/15273、github.com/flutter/flutter/issues/15114 -
不适合我我尝试了两种解决方案@GünterZöchbauer
-
您仍然没有提供
echo $ANDROID_HOME或echo $ANDROID_SKD_ROOT的输出