I am getting this error while I am building APK.
Cause 1: org.gradle.workers.internal.DefaultWorkerExecutor$WorkExecutionException: A failure occurred while
I know this might not be a complete or exact solution, but for those who are still facing issues even after doing what is given on this thread, check for your files in value folder. For me there was a typo and some missing values. Once i fixed them this error stopped.
I removed this issue by adding the following lines
add
multiDexEnabled true
in android>app>build.gradle inside defaultConfigadd
implementation 'com.android.support:multidex:1.0.3'
in android>app>build.gradle inside dependencies
I got an stacktrace similar to yours only when building to Lollipop or Marshmallow, and the solution was to disable Advanved profiling.
Find it here:
Run -> Edit Configurations -> Profiling -> Enable advanced profiling
https://stackoverflow.com/a/58029739/860488
Finally found a solution for this by adding this line to gradle.properties.
org.gradle.jvmargs=-Xmx4608m
search your code you must be referring to color in color.xml
in an xml drawable.
go and give hex code instead of referencing....
Example:
in drawable.xml
you must have called
android:fillColor="@color/blue"
change it to android:fillColor="#ffaacc"
hope it solve your problem...
In my case problem arose due to gradle version upgradation from 6.2 all to 6.6 all in gradle wrapper. So i wiped out data of avd and restarted it and then deleted .gradle folder in android/.gradle and then run yarn start --reset-cache and yarn android. Then it worked for me