flutter_overlay_window
flutter_overlay_window copied to clipboard
flutter_overlay_window example app fails to build due to Java/Gradle incompatibility
Describe the bug When attempting to run the example app from the flutter_overlay_window library on both an Android emulator and a physical Pixel 6 device, the build fails with the error:
FAILURE: Build failed with an exception.
* What went wrong:
Could not open settings generic class cache for settings file '/Users/dmytro/development/multiplatform/Flutter/external/flutter_overlay_window/example/android/settings.gradle' (/Users/dmytro/.gradle/caches/7.6.1/scripts/2g44tlh82yipo013qanfzy4m2).
> 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.org
BUILD FAILED in 312ms
┌─ 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/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 │
│ /Users/dmytro/development/multiplatform/Flutter/external/flutter_overlay_window/example/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 │
│ │
│ │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘
Error: Gradle task assembleDebug failed with exit code 1
To Reproduce Steps to reproduce the behavior:
- Check out the repository for the
flutter_overlay_windowlibrary from GitHub. - Navigate to the
examplefolder within the project. - Open the example project in Android Studio.
- Attempt to run the app on an Android Emulator (Pixel XL API UpsideDownCake with Android API 33 or a physical device like Pixel 6), Java 21.
Expected behavior I expected the app to build and launch on either the emulator or the physical device without any errors so I could test the library’s functionality.
Versions (please complete the following information): • flutter_overlay_window: Latest version from GitHub (path dependency in pubspec.yaml) • Device: Pixel 6 (physical device), Android Emulator, Pixel XL API UpsideDownCake, API Level 33 • OS: macOS 15.1, running Android Studio and Flutter
Additional context I have tried the following steps without resolving the issue:
• Upgraded Gradle to version 8.1.
• Attempted to resolve any dependency conflicts by cleaning and rebuilding the project in Android Studio.
• Tried using “Gradle Assistant” in Android Studio, but the issue persists.