Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flutter_overlay_window example app fails to build due to Java/Gradle incompatibility #138

Open
Turskyi opened this issue Nov 10, 2024 · 0 comments

Comments

@Turskyi
Copy link

Turskyi commented Nov 10, 2024

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:

  1. Check out the repository for the flutter_overlay_window library from GitHub.
  2. Navigate to the example folder within the project.
  3. Open the example project in Android Studio.
  4. 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant