Skip to content

system_alert_window example app fails to build on Android Emulator due to Java/Gradle incompatibility #131

@Turskyi

Description

@Turskyi

Describe the bug
When attempting to run the example app from the system_alert_window library on an Android emulator, the build fails with the following error related to Java and Gradle version incompatibility:

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/SystemAlertWindow/example/android/settings.gradle' (/Users/dmytro/.gradle/caches/7.4/scripts/2gxv3jrc9v0p9reynr1b6cjxo).
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 65

To Reproduce
Steps to reproduce the behavior:

  1. Check out the repository for the system_alert_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), Java 21.

Expected behavior
I expected the app to build successfully and launch on the Android Emulator so I could test the library’s functionality.

Versions (please complete the following information):
• system_alert_window: Latest version from GitHub (path dependency in pubspec.yaml)
• 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.
•	Adjusted Java settings and versions to ensure compatibility.
•	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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions