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

[Flutter] "Could not determine the dependencies of task...

Discussão em 'Mobile' iniciado por Stack, Outubro 10, 2024 às 11:22.

  1. Stack

    Stack Membro Participativo

    Iḿ getting this error when I try to run my flutter project:

    FAILURE: Build failed with an exception.

    * What went wrong:
    Could not determine the dependencies of task ':app:compileDevAndroidDebugJavaWithJavac'.
    > Failed to install the following SDK components:
    platforms;android-34 Android SDK Platform 34
    build-tools;30.0.3 Android SDK Build-Tools 30.0.3
    The SDK directory is not writable (/opt/android-sdk)

    * Try:
    > Run with --stacktrace option to get the stack trace.
    > Run with --info or --debug option to get more log output.
    > Run with --scan to get full insights.

    * Get more help at https://help.gradle.org

    BUILD FAILED in 8s
    Error: Gradle task assembleDevAndroidDebug failed with exit code 1


    My OS is arch (btw) and I have ran


    yes | sdkmanager --licenses

    and


    flutter doctor --android-licenses

    This is the output of running flutter doctor:

    Doctor summary (to see all details, run flutter doctor -v):
    [✓] Flutter (Channel stable, 3.24.3, on Arch Linux 6.9.9-arch1-1, locale pt_BR.UTF-8)
    [!] 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/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.

    ✗ No valid Android SDK platforms found in /opt/android-sdk/platforms. Directory was empty.
    [✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
    [✓] Linux toolchain - develop for Linux desktop
    [!] Android Studio (not installed)
    [✓] Connected device (2 available)
    [✓] Network resources

    ! Doctor found issues in 3 categories.


    I don´t know why it isn´t recognizing /opt/android-sdk as the sdk folder. Also, if this helps with the issue, I have the following exports in my .zshrc file:

    export ANDROID_HOME=/opt/android-sdk
    export PATH=$PATH:$ANDROID_HOME/tools
    export PATH=$PATH:$ANDROID_HOME/platform-tools
    export PATH=$ANDROID_HOME/cmdline-tools/latest/bin/:$PATH

    Continue reading...

Compartilhe esta Página