Open hamishnorton opened 3 weeks ago
I've resolved this issue (for now by configuring flutter to use Java 17).
It looks like Android Studio update installed Java 21 and by running: flutter create .
I could see...
The configured version of Java detected may conflict with the Gradle version in your new Flutter app.
[RECOMMENDED] If so, to keep the default Gradle version 8.3, make
sure to download a compatible Java version
(Java 17 <= compatible Java version < Java 21).
You may configure this compatible Java version by running:
`flutter config --jdk-dir=<JDK_DIRECTORY>`
Note that this is a global configuration for Flutter.
Alternatively, to continue using your configured Java version, update the Gradle
version specified in the following file to a compatible Gradle version (compatible Gradle version range: 8.4 - 8.7):
/Users/hamishnorton/factory/flutter3244/android/gradle/wrapper/gradle-wrapper.properties
You may also update the Gradle version used by running
`./gradlew wrapper --gradle-version=<COMPATIBLE_GRADLE_VERSION>`.
See
https://docs.gradle.org/current/userguide/compatibility.html#java for details
on compatible Java/Gradle versions, and see
https://docs.gradle.org/current/userguide/gradle_wrapper.html#sec:upgrading_wrapper
for more details on using the Gradle Wrapper command to update the Gradle version
used.
I installed Java 17 from https://adoptium.net/temurin/releases/?os=mac&arch=any&version=17
Check it installed with:
/usr/libexec/java_home -V
And set the flutter JDK directory with:
flutter config --jdk-dir=/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home
Upon running flutter doctor -v
it shows Java 17.
And on running flutter create --platform=android .
the message has gone.
And I can now launch the app.
What I am unsure about is that...
Android Studio Ladybug | 2024.2.1 Patch 1 Build #AI-242.23339.11.2421.12483815, built on October 11, 2024 Runtime version: 21.0.3+-79915917-b509.11 aarch64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Toolkit: sun.lwawt.macosx.LWCToolkit macOS 14.6.1 GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation Memory: 2048M Cores: 8 Metal Rendering is ON Registry: ide.experimental.ui=true i18n.locale= Non-Bundled Plugins: Dart (242.22855.32) io.flutter (82.0.3)
Comes with Java 21 and this causes an issue for the mixpanel_flutter
package.
I've avoided the problem be pointing my flutter installation to Java 17 for now.
On launching a bare flutter project with the mixpanel_flutter package included it gives...
pubspec.yaml
flutter doctor -v