Tag Archives: Android resource compilation failed

AndroidStudio Error: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ‘:app:proces

Android studio compile error

org.gradle.api.tasks.TaskExecutionException: Execution failed for task
':app:processDebugResources'.

Android resource compilation failed Output:  
D:\company\SuperMarket\app\build\intermediates\incremen

Caused by: org.gradle.tooling.BuildException: 
Failed to process resources, see aapt output above for

Process 'command 'C:\SDK\build-tools\28.0.3\aapt.exe'' 
finished with non-zero exit value 1

Let’s start with an experience. This kind of problem is often the XML file.

How to locate the problem
open the terminal of Android studio and enter the command on the command line: gradlew compiledebugsource -- stacktrace - info or gradlew assembledebug -- info or gradlew assembledebug

Mac Linux system input:./gradlew compiledebugsource — stacktrace – info

Then you can view the specific compilation report information on the command line. There are many compilation contents. If you look down patiently, you will find a very obvious error prompt:

the file and reason of the error are very detailed.

At the bottom of the compilation information is the error information of the build window

...
D:\company\SuperMarket\app\src\main\res\layout\item_c_day_manager_layout.xml:51:46-61: AAPT: No resource found that matches the given name (at 'layout_constraintLeft_toRightOf' with value
 '@id/tv_work_num').
...

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:processDebugResources'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:103)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:73)
        at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)
        at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101)
        at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)
        at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91)
        at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34
		...