Home > database >  java.lang.OutOfMemoryError when starting Flutter project
java.lang.OutOfMemoryError when starting Flutter project

Time:04-18

everyone I'm working on Flutter project but when I want to run my application I faced this error:

Execution failed for task ':app:xxxxxxxx'.

A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade java.lang.OutOfMemoryError (no error message)

I have tried multiple solutions like:

  • changing the gradle.properties file to:

    • gradle.properties.org.gradle.jvmargs=-xmx4608m
      android.enableR8=true
      android.useAndroidX=true
      android.enableJetifier=true
  • Restarting my Pc

  • Checking that I have enougth memory in my Pc and My phone

  • Raising the minSdkVersion to 30

but it seems not to help too much.

CodePudding user response:

Considering the lack of information you've provided, I can only consider the fact that the good practice for creating mobile applications, judging by the fact that a mobile device's memory is usually lower( and the memory allocation is much slower ), when compared to a computer's memory and memory allocation speed, is to store your information in a database and access the needed information using queries.

CodePudding user response:

A few things you can try:

  1. Run flutter clean and flutter upgrade in the terminal
  2. Uninstall and reinstall the app
  3. (Android Studio) File -> Invalidate Caches and Restart
  4. Restart your computer
  • Related