Flutter does not find android sdk

前端 未结 25 2015
花落未央
花落未央 2020-12-02 09:29

I just tried intalling flutter and since I already had android studio and the android sdk installed I just followed the installation of flutter. Here is my problem: When I r

相关标签:
25条回答
  • 2020-12-02 10:13

    To open Tools=> Android Sdk Click SDK tools tab => check show package details and check all 28 SDK version install that and to fix the issue

    0 讨论(0)
  • 2020-12-02 10:13

    I assume this is this known issue https://github.com/flutter/flutter/issues/13750

    You need to fix the path to the SDK manually until this is fixed in the file

    my_flutter_project/android/local.properties
    

    update

    Add $ANDROID_HOME\sdk\tools and $ANDROID_HOME\sdk\platform-tools to the PATH environment variable.

    0 讨论(0)
  • 2020-12-02 10:13

    First run flutter upgrade from your terminal , If you get the following error,

    ANDROID_HOME = C:\Users\Name\AppData\Local\Android\sdk\Android
          but Android SDK not found at this location.
    
    1. First go to android studio, Settings->System Settings->Click the expand arrow
    2. Then go to the Android SDK option and add the corresponding SDK to the project then go to Project Structure and add the respective SDK to the project Structure
    3. Then run flutter upgrade in the terminal
    0 讨论(0)
  • 2020-12-02 10:16

    What worked is Tools->Flutter->open Android module in Android studio, For me plugin flutter_email_sender was giving this error, so I copied local.properties file into it and the build become successful.

    Or Open Terminal Run touch ~/.bash_profile; open ~/.bash_profile

    export ANDROID_HOME=/Users/<macusername>/Library/Android/sdk
    export ANDROID_SDK_ROOT=/Users/<macusername>/Library/Android/sdk
    export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
    

    Run source ~/.bash_profile in android studio terminal

    0 讨论(0)
  • 2020-12-02 10:16

    This solved my issue.

    • Step 1: In search type show hidden files and enable it.
    • Step 2: Go to C directoy> users>
    • Step 3: In that navigate to AppData>Local>Android>Sdk
    • Step 4: Copy the path to this folder
    • Step 5: Open power-shell and type in:

    flutter config --android-sdk "C:\Users<folder under your name>\AppData\Local\Android\Sdk"

    All the best :)

    0 讨论(0)
  • 2020-12-02 10:22

    I solved this problem by below step,

    1) go to -> system environment -> Environment Variables -> system Variable

    2) create New Variable Name ANDROID_HOME and Value D:\Androidsdk\tools (custom android sdk path).

    3) concat this path D:\Androidsdk\platform-tools in Path variable value using ";". (also in system Variable)

    4) that's all, Restart the PC to apply changes and try again -- flutter Doctor.

    0 讨论(0)
提交回复
热议问题