Skip to content

Fix Gradle/Java compatibility issue #77

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Makram-BenRhouma-Dev
Copy link

Problem

The project was failing to build with the error Unsupported class file major version 65, which occurs when using Java 21 with older Gradle versions that don't support it.

Solution

This PR updates the build configuration to ensure compatibility between Java 21 and the build tools:

Changes Made:

  • Updated Gradle version from 7.6.3 to 8.4 (supports Java 21)
  • Updated Android Gradle Plugin from 7.3.0 to 8.1.4 (compatible with Gradle 8.4)
  • Updated Kotlin version from 1.7.10 to 1.9.10 (compatible with newer AGP)
  • Updated Java compatibility from version 1.8 to 17 (recommended for modern Android development)
  • Updated Kotlin JVM target from '1.8' to '17'

Files Modified:

  • android/gradle/wrapper/gradle-wrapper.properties
  • android/settings.gradle
  • android/app/build.gradle

Testing

After these changes, the project should build successfully with:

flutter clean
flutter pub get
flutter run

Compatibility Matrix

  • ✅ Java 21 (system Java version)
  • ✅ Gradle 8.4 (supports Java 21)
  • ✅ Android Gradle Plugin 8.1.4 (compatible with Gradle 8.4)
  • ✅ Java 17 target (recommended for Android development)

This resolves the build failure and ensures the project can run on systems with Java 21.


Pull Request opened by Augment Code with guidance from the PR author

- Update Gradle version from 7.6.3 to 8.4 to support Java 21
- Update Android Gradle Plugin from 7.3.0 to 8.1.4
- Update Kotlin version from 1.7.10 to 1.9.10
- Update Java compatibility from version 1.8 to 17
- Update Kotlin JVM target from '1.8' to '17'

This resolves the 'Unsupported class file major version 65' error
that occurs when using Java 21 with older Gradle versions.
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

Successfully merging this pull request may close these issues.

1 participant