簡體   English   中英

flutter 找不到 android sdk?

[英]flutter can not find android sdk?

我已經在 ubuntu 18.04 上安裝了 flutter 並且我還安裝了 android 工作室,它工作正常,但是當我運行 Z5ACEBC4CB70DDBB074B0AC7AE Doctor flutter 找不到 android 工具鏈。 並且在dart插件和flutter插件之前也有紅十字。 我不知道為什么會這樣。 我也安裝了 flutter 插件和 dart 插件。但紅十字仍然存在。

這是flutter博士的出來

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.dev/docs/get-started/install/linux#android-setup
      for detailed instructions).
      If the Android SDK has been installed to a custom location, set
      ANDROID_SDK_ROOT to that location.
      You may also want to add it to your PATH environment variable.

如錯誤消息所述,您的環境變量中未設置ANDROID_SDK_ROOT或以前稱為ANDROID_HOME

要解決此問題,您需要:

export ANDROID_SDK_ROOT=/path/to/android/studio/installation
export ANDROID_HOME=/path/to/android/studio/installation
export PATH=$PATH:/path/to/android/studio/installation

由於一些遺留原因,有一些變量指向同一件事。 為了確保您的 Flutter SDK 得到它,您可以設置所有這些。

注意:如果您不想在每次筆記本電腦重新啟動時都設置它們,請隨時將它們添加到~/.bashrc中。

理論上,在 Android Studio 的安裝過程中,應該為您設置上述變量,但實際上並不總是發生,這就是您看到錯誤消息的原因。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM