3
respostas

FAILURE: Build failed with an exception.

Após fazer o flutter emulator e abrir o emulador, fiz o flutter run e apareceu a seguinte mensagem :

C:\Users\Win 10\Documents\bytebank>flutter run Using hardware rendering with device sdk gphone x86. If you notice graphics artifacts, consider enabling software rendering with "--enable-software-rendering". Launching lib\main.dart on sdk gphone x86 in debug mode...

FAILURE: Build failed with an exception.

  • What went wrong: Could not open settings generic class cache for settings file 'C:\Users\Win 10\Documents\bytebank\android\settings.gradle' (C:\Users\Win 10.gradle\caches\6.7\scripts\1fnwrr8g4rohfp291nvlxj5qe).

    BUG! exception in phase 'semantic analysis' in source unit 'BuildScript' Unsupported class file major version 60

  • 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 1m 16s Running Gradle task 'assembleDebug'... Running Gradle task 'assembleDebug'... Done 81,2s Exception: Gradle task assembleDebug failed with exit code 1

3 respostas

Por favor, rode o comando flutter doctor -v na raiz do seu projeto e coloque a saída aqui.

fiz o comando flutter doctor -v e apareceu isso

C:\Users\Win 10\bytebank>flutter doctor -v
[√] Flutter (Channel stable, 2.2.3, on Microsoft Windows [versão 10.0.19042.1165], locale pt-BR)
    • Flutter version 2.2.3 at C:\flutter
    • Framework revision f4abaa0735 (7 weeks ago), 2021-07-01 12:46:11 -0700
    • Engine revision 241c87ad80
    • Dart version 2.13.4

[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at C:\Users\Win 10\AppData\Local\Android\sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: C:\Program Files\Java\jdk-16.0.2\bin\java
    • Java version Java(TM) SE Runtime Environment (build 16.0.2+7-67)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).

[√] IntelliJ IDEA Community Edition (version 2021.2)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2021.2
    • Flutter plugin version 59.0.4
    • Dart plugin version 212.4746.57

[√] VS Code (version 1.59.0)
    • VS Code at C:\Users\Win 10\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension can be installed from:
       https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[√] Connected device (3 available)
    • sdk gphone x86 (mobile) • emulator-5554 • android-x86    • Android 11 (API 30) (emulator)
    • Chrome (web)            • chrome        • web-javascript • Google Chrome 92.0.4515.159
    • Edge (web)              • edge          • web-javascript • Microsoft Edge 92.0.902.73

! Doctor found issues in 1 category.

Ao invés de rodar com flutter run, tente rodar com flutter run --debug. Talvez você receba mais detalhes do erro.