A Failure Occurred While Executing Com.Android.Build.Gradle.Internal.Tasks

A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable

The approved solution defeats the purpose of having a smart Gradle build process which compiles and links only the required code. If every time this error occurs the solution is to stop and delete the build you are killing productivity.

I get this error about 1 out of every 10 builds.

My quick fix - is within Android Studio - open the Terminal panel (typically bottom of studio). Run shell command

rm -rf build/output/apk

This always works - but still is a big pain to do every 10 builds.
I have had this problem for the last year, so multiple OS updates, multiple Studio updates, etc.

Wish they would fix this.
I have tried to disable "incremental building", but no impact on this problem.

gradle.properties

org.gradle.parallel=false
org.gradle.caching=false
org.gradle.configureondemand=false

build.gradle

gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.incremental = false

}
}

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

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 ✔️



Related Topics



Leave a reply



Submit