0

I am a beginner in flutter application development. And when I Run my flutter default project code on emulator, I face this issue:

Launching lib\main.dart on AOSP on IA Emulator in debug mode... Running Gradle task 'assembleDebug'...

FAILURE: Build failed with an exception.

  • What went wrong: Could not open settings generic class cache for settings file 'C:\Users\Administrator\StudioProjects\myapp\android\settings.gradle' (C:\Users\Administrator.gradle\caches\6.7\scripts\1fnwrr8g4rohfp291nvlxj5qe).

BUG! exception in phase 'semantic analysis' in source unit 'BuildScript' Unsupported class file major version 60

  • Does this answer your question? [Could not open settings generic class cache for settings file '](https://stackoverflow.com/questions/67240279/could-not-open-settings-generic-class-cache-for-settings-file) – colinD Aug 04 '21 at 12:41
  • its an issue related to Java version in use. I am guessing you are using a higher JDK version such as JDK 16. In such a case you might be able to solve the problem by specifying target and source Java version in the gradle file. – Gautam Aug 04 '21 at 12:51

1 Answers1

0

Make sure you have the JAVA_HOME in your environment variables.

Example for path:

C:\Program Files\Java\jdk-16.0.2

And check that the flutter doctor is running successfully:

flutter doctor

a guide to setting the JAVA_HOME variable in Windows

https://confluence.atlassian.com/doc/setting-the-java_home-variable-in-windows-8895.html

EyaS
  • 477
  • 3
  • 9