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

[Flutter] Flutter: FAILURE: Build failed with an exception. * What went wrong: Execution...

Discussão em 'Mobile' iniciado por Stack, Setembro 27, 2024 às 15:33.

  1. Stack

    Stack Membro Participativo

    I want to use audio files from local storage in Flutter, and for that, I want to use the 'on_audio_query: ^2.9.0' library. However, I am encountering a problem like the one below:

    `FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':eek:n_audio_query_android:compileDebugKotlin'.
    > 'compileDebugJavaWithJavac' task (current target is 1.8) and 'compileDebugKotlin' task (current target is 17) jvm target compatibility should be set to the same Java version.
    Consider using JVM toolchain: https://kotl.in/gradle/jvm/toolchain

    * 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.

    BU�LD FAILED in 5s
    Error: Gradle task assembleDebug failed with exit code 1`


    app\build.gradle:

    compileOptions {
    sourceCompatibility = JavaVersion.VERSION_1_8
    targetCompatibility = JavaVersion.VERSION_1_8
    }

    kotlinOptions {
    jvmTarget = JavaVersion.VERSION_1_8
    }


    I tried this as a solution, but I didn’t get any results.

    android {
    compileOptions {
    sourceCompatibility JavaVersion.VERSION_17
    targetCompatibility JavaVersion.VERSION_17
    }
    kotlinOptions {
    jvmTarget = "17"
    }
    }

    Continue reading...

Compartilhe esta Página