Closed AbdeMohlbi closed 1 week ago
Thanks for filing the issue. I also can reproduce this on a new project created with Flutter master channel, it doesn't occur with Flutter stable 3.19.6.
@huycozy Have u tried my fix has it work ?
Yes, adding kotlinOptions
back can make it works
@flutter/android-reviewers FYI @bartekpacia fyi.
I think in general we will probably either remove or bump the java source compatibility from 1.8 to 11 or 17.
@flutter/android-reviewers FYI @bartekpacia fyi.
I think in general we will probably either remove or bump the java source compatibility from 1.8 to 11 or 17.
I don't know if this is related but i'm using jdk 21
@gmackall i suggest this
kotlinOptions {
jvmTarget = '1.8'
}
also something weird but works(performs faster and i don't know why):
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile.class){
kotlinOptions {
jvmTarget = "1.8"
}
}
@AbdeMohlbi I think we should keep this issue open until the linked PR got merged
Steps to reproduce
when creating a new flutter project using the flutter create project then updating the
settings.gradle
as follows(i'm using gradle 8.6 ) :i'm getting this error :
Expected results
well it supposed to work without any issues (this was my config always for flutter 3.19.6 and it always worked even with 3.19.5) i've seen : stackoverflow,and this video so after doing that i could run the app normally by updating the
app/build.gradle
like that :my question is should the minimal tempalte app trigger this kind of error ? if this is the case i guess this block need to be added to the
app/build.gradle
fileActual results
this error apears :
Code sample
Code sample
```dart import 'package:flutter/material.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), useMaterial3: true, ), home: const MyHomePage(title: 'Flutter Demo Home Page'), ); } } class MyHomePage extends StatefulWidget { const MyHomePage({super.key, required this.title}); final String title; @override StateScreenshots or Video
Screenshots / Video demonstration
[Upload media here]Logs
Logs
```console [Paste your logs here] ```Flutter Doctor output
Doctor output
```console [√] Flutter (Channel master, 3.22.0-15.0.pre.1, on Microsoft Windows [version 10.0.19045.4239], locale en-US) • Flutter version 3.22.0-15.0.pre.1 on channel master at C:\src\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 1a905d508d (33 hours ago), 2024-04-21 06:44:23 -0400 • Engine revision 75ca2195c9 • Dart version 3.5.0 (build 3.5.0-83.0.dev) • DevTools version 2.35.0-dev.8 [√] Windows Version (Installed version of Windows is version 10 or higher) [√] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at C:\Users\bougara computer\AppData\Local\Android\Sdk • Platform android-UpsideDownCakePrivacySandbox, build-tools 34.0.0 • Java binary at: C:\Users\bougara computer\Desktop\android-studio\jbr\bin\java • Java version OpenJDK Runtime Environment (build 17.0.9+0--11185874) • All Android licenses accepted. [√] Chrome - develop for the web • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe [√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.3.2) • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community • Visual Studio Community 2022 version 17.3.32819.101 • Windows 10 SDK version 10.0.19041.0 [√] Android Studio (version 2023.3) • Android Studio at C:\Users\bougara computer\Desktop\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 • Java version OpenJDK Runtime Environment (build 17.0.9+0--11185874) [√] VS Code, 64-bit edition (version 1.88.1) • VS Code at C:\Program Files\Microsoft VS Code • Flutter extension version 3.72.0 [√] Connected device (4 available) • M2003J15SC (mobile) • 05d3e1490405 • android-arm64 • Android 11 (API 30) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [version 10.0.19045.4239] • Chrome (web) • chrome • web-javascript • Google Chrome 123.0.6312.124 • Edge (web) • edge • web-javascript • Microsoft Edge 124.0.2478.51 ```