flutterdartgradleexception

A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction


I am getting this while trying to run build in debug mode

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
   > java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $

I already ran flutter clean then flutter pub get before launching the app again. It still not going! The flutter doctor command result is OK and fine too


Solution

  • It finally worked! I solved the problem by adding adding org.gradle.jvmargs=-Xmx4608m in the gradle.properties file and deleting the./gradle/cahes directly ✔️