1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Flutter] flutter doctor - unable to locate android sdk on ubuntu

Discussão em 'Mobile' iniciado por Stack, Outubro 13, 2024 às 18:42.

  1. Stack

    Stack Membro Participativo

    Running flutter doctor -v on my ubuntu 24.04.1 installation reports these problems

    • Unable to locate Android SDK
    • No valid Android SDK platforms found in /usr/local/android-sdk/platforms. Directory was empty.
    • Unable to determine Android Studio version
    What did i try


    Running ./sdkmanager --list_installed returned

    $ cd /usr/local/android-sdk/cmdline-tools/latest/bin
    $ ./sdkmanager --list_installed
    [=======================================] 100% Fetch remote repository...
    Installed packages:
    Path | Version | Description | Location
    ------- | ------- | ------- | -------
    platform-tools | 35.0.2 | Android SDK Platform-Tools 35.0.2 | platform-tools



    So i ran also

    $ cd /usr/local/android-sdk/cmdline-tools/latest/bin
    $ sudo ./sdkmanager "emulator"
    $ sudo ./sdkmanager "build-tools;35.0.0"
    $ sudo ./sdkmanager "cmdline-tools;latest"


    Now ./sdkmanager --list_installed returns

    /usr/local/android-sdk/cmdline-tools/latest/bin$ ./sdkmanager --list_installed
    [=======================================] 100% Fetch remote repository...
    Installed packages:
    Path | Version | Description | Location
    ------- | ------- | ------- | -------
    build-tools;35.0.0| 35.0.0 | SDK Build-Tools 35 | build-tools/35.0.0
    cmdline-tools;latest| 16.0 | SDK Command-line Tools | cmdline-tools/latest
    emulator | 35.2.10 | Emulator | emulator
    platform-tools | 35.0.2 | SDK Platform-Tools 35.0.2 | platform-tools


    The last lines of my ~/.bashrc are

    export ANDROID_HOME=/usr/local/android-sdk
    export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools


    Running tree -dL 2 /usr/local/android-sdk returns

    /usr/local/android-sdk
    ├── build-tools
    │ └── 35.0.0
    ├── cmdline-tools
    │ └── latest
    ├── emulator
    │ ├── bin64
    │ ├── include
    │ ├── lib
    │ ├── lib64
    │ ├── qemu
    │ └── resources
    ├── licenses
    └── platform-tools
    └── lib64


    Still the same problem


    This is the output of flutter doctor -v

    [!] Android toolchain - develop for Android devices
    • Android SDK at /usr/local/android-sdk
    ✗ 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/to/linux-android-setup for detailed instructions).
    If the Android SDK has been installed to a custom location, please use
    `flutter config --android-sdk` to update to that location.

    • ANDROID_HOME = /usr/local/android-sdk
    ✗ No valid Android SDK platforms found in /usr/local/android-sdk/platforms. Directory was empty.
    • Try re-installing or updating your Android SDK,
    visit https://flutter.dev/to/linux-android-setup for detailed instructions.


    [!] Android Studio (version unknown)
    • Android Studio at /opt/android-studio
    • Flutter plugin can be installed from:
    https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
    https://plugins.jetbrains.com/plugin/6351-dart
    ✗ Unable to determine Android Studio version.
    • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)

    Question


    What else can i do to fix

    • Unable to locate Android SDK
    • No valid Android SDK platforms found in /usr/local/android-sdk/platforms

    Continue reading...

Compartilhe esta Página