Versão do Java: 17.0.11. Ao eu executar o build do projeto 01, gerar APK no Android Studio, ocorrem os erros, que seguem abaixo:
/home/evaldo/softwares/flutter_linux_3.27.0/bin/flutter --no-color build apk Resolving dependencies... Downloading packages... args 2.4.2 (2.6.0 available) async 2.11.0 (2.12.0 available) boolean_selector 2.1.1 (2.1.2 available) characters 1.3.0 (1.4.0 available) clock 1.1.1 (1.1.2 available)
collection 1.19.0 (was 1.17.1) (1.19.1 available) cupertino_icons 1.0.5 (1.0.8 available) fake_async 1.3.1 (1.3.2 available) flutter_lints 2.0.1 (5.0.0 available) flutter_svg 2.0.7 (2.0.16 available) http 1.1.0 (1.2.2 available) http_parser 4.0.2 (4.1.2 available)
- leak_tracker 10.0.7 (10.0.8 available)
- leak_tracker_flutter_testing 3.0.8 (3.0.9 available)
- leak_tracker_testing 3.0.1
lints 2.1.1 (5.1.1 available)
matcher 0.12.16+1 (was 0.12.15) (0.12.17 available) material_color_utilities 0.11.1 (was 0.2.0) (0.12.0 available) meta 1.15.0 (was 1.9.1) (1.16.0 available) path 1.9.0 (was 1.8.3) (1.9.1 available) path_parsing 1.0.1 (1.1.0 available) petitparser 5.4.0 (6.0.2 available) < sky_engine 0.0.0 from sdk flutter (was 0.0.99 from sdk flutter) source_span 1.10.0 (was 1.9.1) (1.10.1 available) sqflite 2.2.8+4 (2.4.1 available) sqflite_common 2.4.5+1 (2.5.4+6 available) stack_trace 1.12.0 (was 1.11.0) (1.12.1 available) stream_channel 2.1.2 (was 2.1.1) (2.1.3 available) string_scanner 1.3.0 (was 1.2.0) (1.4.1 available) synchronized 3.1.0 (3.3.0+3 available) term_glyph 1.2.1 (1.2.2 available) test_api 0.7.3 (was 0.5.1) (0.7.4 available) typed_data 1.3.2 (1.4.0 available) vector_graphics 1.1.7 (1.1.15 available) vector_graphics_codec 1.1.7 (1.1.12 available) vector_graphics_compiler 1.1.7 (1.1.16 available)
- vm_service 14.3.0 (15.0.0 available) xml 6.3.0 (6.5.0 available) These packages are no longer being depended on:
- js 0.6.7
Changed 16 dependencies!
36 packages have newer versions incompatible with dependency constraints.
Try
flutter pub outdated
for more information. Running Gradle task 'assembleRelease'... FAILURE: Build failed with an exception.
- What went wrong:
Could not open settings generic class cache for settings file
'/home/evaldo/workspace_2019/3116-Flutter-MVC-Aula1/android/settings.gradle'
(/home/evaldo/.gradle/caches/7.5/scripts/cmhfpkcf7ocfllmygpx5lw7ur).
BUG! exception in phase 'semantic analysis' in source unit 'BuildScript' Unsupported class file major version 65
- 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.orgBUILD FAILED in 1m 8s
Running Gradle task 'assembleRelease'...
69,6s
┌─ Flutter Fix ────────────────────────────────────────────────────────────────┐
│ [!] Your project's Gradle version is incompatible with the Java version that
| Flutter is using for Gradle.
│
│
│ If you recently upgraded Android Studio, consult the migration guide at
│
│ https://flutter.dev/to/java-gradle-incompatibility.
│
│
│ Otherwise, to fix this issue, first, check the Java version used by Flutter by
| running
flutter doctor --verbose
. │ │ │ Then, update the Gradle version specified in │ /home/evaldo/workspace_2019/3116-Flutter-MVC-Aula1/android/gradle/wrapper/ | gradle-wrapper.properties to be compatible with that Java version. See the | link below for more information on compatible Java/Gradle versions: │ │ https://docs.gradle.org/current/userguide/compatibility.html#java │ │ │ │ │ └──────────────────────────────────────────────────────────────────────────────┘ Gradle task assembleRelease failed with exit code 1 Process finished with exit code 1
Parece que o Flutter está reclamando da versão da JDK do Java.