0

Can't do flutter run. flutter doctor is ok What to do?(flutter ver 2.8.1)

Failed to execute org.gradle.cache.internal.AsyncCacheAccessDecoratedCache$2@7c56f8f1. java.lang.OutOfMemoryError: Java heap space

user1942979
  • 119
  • 1
  • 2
  • 6

1 Answers1

0

Answer located here: Android Studio Build gradle OutOfMemoryError

Step 1 : Start Android studio and close any open project (File > Close Project).

Step 2 : On Welcome window, Go to Configure > Settings.

Step 3 : Go to Build, Execution, Deployment > Compiler

Step 4 : Change Build process heap size (Mbytes) to 512 and Additional build process to VM Options to -Xmx512m. Or any memory allocation in correspondent to your PC

Step 5 : Revalidate/Restart Android Studio.

Or you can also try commenting out this block in build.gradle

splits {
    abi {
        enable true
        reset()
        include 'x86', 'x86_64', 'armeabi', 'armeabi-v7a', 'mips', 'mips64', 'arm64-v8a'
        universalApk true
    }
}
  • It does not helps.I can see after adding this parameters: [ +95 ms] > Task :app:mergeDebugAssets [+30000 ms] > Task :app:copyFlutterAssetsDebug [+281900 ms] FAILURE: Build failed with an exception. [ +2 ms] * What went wrong: [ ] Java heap space – user1942979 Dec 29 '21 at 10:14