Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter build error for the first time :Could not open settings remapped class cache for 7yvt6la2007dno98lt3rzbguf

I just downloaded Flutter and tried to learn the emulator with the first default code which Google offered. But it does not run at all!

I have the dart and flutter plugins installed. I also changed the order of jcenter() and google() too

like this:

buildscript {
    ext.kotlin_version = '1.3.50'
    repositories {
        jcenter()
        google()
    }

   
dependencies {
        classpath 'com.android.tools.build:gradle:3.5.0'

        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

allprojects {
    repositories {
        jcenter()
        google()

    }
}

And the error is:

Launching lib/main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...

FAILURE: Build failed with an exception.

* What went wrong:
Could not open settings remapped class cache for 7yvt6la2007dno98lt3rzbguf (/Users/[myname]/.gradle/caches/5.6.2/scripts-remapped/settings_7iv4l88jiyzeatj2wku74hwcv/7yvt6la2007dno98lt3rzbguf/settings8410a2d21ed2f87c8a0398566330ee52).
> Could not open settings generic class cache for settings file '/Users/[myname]/AndroidStudioProjects/test_app/android/settings.gradle' (/Users/[myname]/.gradle/caches/5.6.2/scripts/7yvt6la2007dno98lt3rzbguf/settings/settings8410a2d21ed2f87c8a0398566330ee52).
   > BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 57

* 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 568ms
Finished with error: Gradle task assembleDebug failed with exit code 1
like image 871
Anat's Avatar asked Feb 09 '20 23:02

Anat's


People also ask

How do you fix could not open settings generic class cache for settings file?

To Solve Could not open settings generic class cache for settings file Error If You are using java 12, 13 Or Any Version execpt Java 8 Then You just have to unistall java and reinstall java 8 version. By using java 8 will solve this error.


2 Answers

I don't know reason for this error. But I was updated gradle version to the latest in gradle-wrapper.properties file. Then sync. It worked for me.

distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
like image 145
Chamindu Avatar answered Sep 19 '22 03:09

Chamindu


You need to update version of Gradle:

  1. go to https://gradle.org/install/ and get info about last version (for now it is 7.1.1)
  2. open gradle/wrapper/gradle-wrapper.properties and change version to last

distributionUrl=https://services.gradle.org/distributions/gradle-7.1.1-all.zip

like image 34
Cyrax Avatar answered Sep 20 '22 03:09

Cyrax